# Flyto Agent Engine — Benchmark Baseline # # Generated: 2026-04-16 # Environment: Linux amd64, Intel Xeon (Skylake) # Go version: see go.mod # # Covers: normalizer, filecache, tokenizer, schema adaptation, message conversion # Sampling: -count=3 for benchstat statistical comparison # # How to compare after code changes: # # go test ./pkg/engine/ ./internal/tokenizer/ ./internal/wire/ \ # -bench=. -benchmem -run=^$ -count=3 > /tmp/new.txt # benchstat docs/benchmark-baseline.txt /tmp/new.txt # # Install benchstat if needed: # # go install golang.org/x/perf/cmd/benchstat@latest # # What to look for: # - delta% > +10% on any hot path = investigate # - allocs/op increase = check for new allocations in the changed code # - p-value > 0.05 = difference is noise, ignore # goos: linux goarch: amd64 pkg: flyto-agent/pkg/engine cpu: Intel Xeon Processor (Skylake, IBRS) BenchmarkNormalizeMessagesForAPI/text_10_msgs-8 72402 14715 ns/op 11568 B/op 63 allocs/op BenchmarkNormalizeMessagesForAPI/text_10_msgs-8 82905 16512 ns/op 11568 B/op 63 allocs/op BenchmarkNormalizeMessagesForAPI/text_10_msgs-8 93255 14121 ns/op 11568 B/op 63 allocs/op BenchmarkNormalizeMessagesForAPI/text_50_msgs-8 16951 69606 ns/op 58352 B/op 243 allocs/op BenchmarkNormalizeMessagesForAPI/text_50_msgs-8 17409 70701 ns/op 58352 B/op 243 allocs/op BenchmarkNormalizeMessagesForAPI/text_50_msgs-8 17743 66141 ns/op 58352 B/op 243 allocs/op BenchmarkNormalizeMessagesForAPI/text_100_msgs-8 7885 137328 ns/op 116320 B/op 468 allocs/op BenchmarkNormalizeMessagesForAPI/text_100_msgs-8 8583 133039 ns/op 116320 B/op 468 allocs/op BenchmarkNormalizeMessagesForAPI/text_100_msgs-8 10000 137363 ns/op 116320 B/op 468 allocs/op BenchmarkNormalizeMessagesForAPI/text_500_msgs-8 1468 748638 ns/op 580067 B/op 2268 allocs/op BenchmarkNormalizeMessagesForAPI/text_500_msgs-8 1495 731894 ns/op 580067 B/op 2268 allocs/op BenchmarkNormalizeMessagesForAPI/text_500_msgs-8 1555 836889 ns/op 580071 B/op 2268 allocs/op BenchmarkNormalizeMessagesForAPI_WithTools/5_tool_pairs-8 47990 25190 ns/op 14928 B/op 83 allocs/op BenchmarkNormalizeMessagesForAPI_WithTools/5_tool_pairs-8 52290 25397 ns/op 14928 B/op 83 allocs/op BenchmarkNormalizeMessagesForAPI_WithTools/5_tool_pairs-8 51392 24691 ns/op 14928 B/op 83 allocs/op BenchmarkNormalizeMessagesForAPI_WithTools/20_tool_pairs-8 11943 102185 ns/op 62712 B/op 293 allocs/op BenchmarkNormalizeMessagesForAPI_WithTools/20_tool_pairs-8 9794 105347 ns/op 62712 B/op 293 allocs/op BenchmarkNormalizeMessagesForAPI_WithTools/20_tool_pairs-8 11414 104161 ns/op 62713 B/op 293 allocs/op BenchmarkNormalizeMessagesForAPI_WithTools/50_tool_pairs-8 4257 254960 ns/op 159545 B/op 689 allocs/op BenchmarkNormalizeMessagesForAPI_WithTools/50_tool_pairs-8 3788 269219 ns/op 159545 B/op 689 allocs/op BenchmarkNormalizeMessagesForAPI_WithTools/50_tool_pairs-8 4795 239144 ns/op 159545 B/op 689 allocs/op BenchmarkFileStateCache_RecordAndGet/Record-8 263571 4711 ns/op 560 B/op 8 allocs/op BenchmarkFileStateCache_RecordAndGet/Record-8 233544 4792 ns/op 560 B/op 8 allocs/op BenchmarkFileStateCache_RecordAndGet/Record-8 267810 4577 ns/op 560 B/op 8 allocs/op BenchmarkFileStateCache_RecordAndGet/Get_Hit-8 3664626 347.7 ns/op 32 B/op 1 allocs/op BenchmarkFileStateCache_RecordAndGet/Get_Hit-8 3476511 318.8 ns/op 32 B/op 1 allocs/op BenchmarkFileStateCache_RecordAndGet/Get_Hit-8 3738444 287.4 ns/op 32 B/op 1 allocs/op BenchmarkFileStateCache_RecordAndGet/Get_Miss-8 3084628 357.2 ns/op 40 B/op 1 allocs/op BenchmarkFileStateCache_RecordAndGet/Get_Miss-8 3329041 341.8 ns/op 40 B/op 1 allocs/op BenchmarkFileStateCache_RecordAndGet/Get_Miss-8 2825236 361.4 ns/op 40 B/op 1 allocs/op BenchmarkFileStateCache_RecentFiles/top_10-8 4072430 268.3 ns/op 160 B/op 1 allocs/op BenchmarkFileStateCache_RecentFiles/top_10-8 5594677 253.1 ns/op 160 B/op 1 allocs/op BenchmarkFileStateCache_RecentFiles/top_10-8 4455136 240.4 ns/op 160 B/op 1 allocs/op BenchmarkFileStateCache_RecentFiles/top_50-8 1630334 769.0 ns/op 896 B/op 1 allocs/op BenchmarkFileStateCache_RecentFiles/top_50-8 1530033 796.5 ns/op 896 B/op 1 allocs/op BenchmarkFileStateCache_RecentFiles/top_50-8 1710196 750.0 ns/op 896 B/op 1 allocs/op PASS ok flyto-agent/pkg/engine 46.057s goos: linux goarch: amd64 pkg: flyto-agent/internal/tokenizer cpu: Intel Xeon Processor (Skylake, IBRS) BenchmarkEstimateTokens/English_short-8 300936 3925 ns/op 464 B/op 28 allocs/op BenchmarkEstimateTokens/English_short-8 332446 3908 ns/op 464 B/op 28 allocs/op BenchmarkEstimateTokens/English_short-8 244366 4221 ns/op 464 B/op 28 allocs/op BenchmarkEstimateTokens/English_1KB-8 10593 109850 ns/op 14464 B/op 721 allocs/op BenchmarkEstimateTokens/English_1KB-8 9808 122184 ns/op 14464 B/op 721 allocs/op BenchmarkEstimateTokens/English_1KB-8 9937 115670 ns/op 14464 B/op 721 allocs/op BenchmarkEstimateTokens/CJK_short-8 3300643 332.7 ns/op 0 B/op 0 allocs/op BenchmarkEstimateTokens/CJK_short-8 2952471 400.9 ns/op 0 B/op 0 allocs/op BenchmarkEstimateTokens/CJK_short-8 3259680 338.9 ns/op 0 B/op 0 allocs/op BenchmarkEstimateTokens/CJK_1KB-8 62876 17860 ns/op 1792 B/op 1 allocs/op BenchmarkEstimateTokens/CJK_1KB-8 54338 19059 ns/op 1792 B/op 1 allocs/op BenchmarkEstimateTokens/CJK_1KB-8 61396 18472 ns/op 1792 B/op 1 allocs/op BenchmarkEstimateTokens/Code_Go-8 36394 30267 ns/op 3096 B/op 153 allocs/op BenchmarkEstimateTokens/Code_Go-8 39544 29913 ns/op 3096 B/op 153 allocs/op BenchmarkEstimateTokens/Code_Go-8 40098 27398 ns/op 3096 B/op 153 allocs/op BenchmarkEstimateTokens/Mixed_CJK_English-8 18646 64297 ns/op 7392 B/op 351 allocs/op BenchmarkEstimateTokens/Mixed_CJK_English-8 18056 62063 ns/op 7392 B/op 351 allocs/op BenchmarkEstimateTokens/Mixed_CJK_English-8 20052 61541 ns/op 7392 B/op 351 allocs/op BenchmarkEstimateMessageTokens/5_msgs-8 50242 22385 ns/op 2440 B/op 140 allocs/op BenchmarkEstimateMessageTokens/5_msgs-8 56296 21945 ns/op 2440 B/op 140 allocs/op BenchmarkEstimateMessageTokens/5_msgs-8 50656 22351 ns/op 2440 B/op 140 allocs/op BenchmarkEstimateMessageTokens/20_msgs-8 13914 85514 ns/op 9760 B/op 560 allocs/op BenchmarkEstimateMessageTokens/20_msgs-8 14059 84134 ns/op 9760 B/op 560 allocs/op BenchmarkEstimateMessageTokens/20_msgs-8 13630 91006 ns/op 9760 B/op 560 allocs/op BenchmarkEstimateMessageTokens/100_msgs-8 2662 449385 ns/op 48800 B/op 2800 allocs/op BenchmarkEstimateMessageTokens/100_msgs-8 3188 460505 ns/op 48800 B/op 2800 allocs/op BenchmarkEstimateMessageTokens/100_msgs-8 2576 442035 ns/op 48800 B/op 2800 allocs/op PASS ok flyto-agent/internal/tokenizer 31.594s goos: linux goarch: amd64 pkg: flyto-agent/internal/wire cpu: Intel Xeon Processor (Skylake, IBRS) BenchmarkAdaptSchema/simple/anthropic-8 43100 23649 ns/op 3546 B/op 70 allocs/op BenchmarkAdaptSchema/simple/anthropic-8 44396 25524 ns/op 3546 B/op 70 allocs/op BenchmarkAdaptSchema/simple/anthropic-8 50352 21156 ns/op 3546 B/op 70 allocs/op BenchmarkAdaptSchema/simple/openai-8 240531247 5.413 ns/op 0 B/op 0 allocs/op BenchmarkAdaptSchema/simple/openai-8 235043079 4.999 ns/op 0 B/op 0 allocs/op BenchmarkAdaptSchema/simple/openai-8 213501984 5.128 ns/op 0 B/op 0 allocs/op BenchmarkAdaptSchema/simple/gemini-8 236078883 4.752 ns/op 0 B/op 0 allocs/op BenchmarkAdaptSchema/simple/gemini-8 275525136 4.294 ns/op 0 B/op 0 allocs/op BenchmarkAdaptSchema/simple/gemini-8 277863130 4.560 ns/op 0 B/op 0 allocs/op BenchmarkAdaptSchema/simple/minimax-8 269530459 4.568 ns/op 0 B/op 0 allocs/op BenchmarkAdaptSchema/simple/minimax-8 211705335 5.244 ns/op 0 B/op 0 allocs/op BenchmarkAdaptSchema/simple/minimax-8 238072015 5.113 ns/op 0 B/op 0 allocs/op BenchmarkAdaptSchema/nested/anthropic-8 8779 117930 ns/op 15528 B/op 264 allocs/op BenchmarkAdaptSchema/nested/anthropic-8 8926 132248 ns/op 15529 B/op 264 allocs/op BenchmarkAdaptSchema/nested/anthropic-8 9618 131929 ns/op 15529 B/op 264 allocs/op BenchmarkAdaptSchema/ref_dedup/gemini-8 186650638 5.820 ns/op 0 B/op 0 allocs/op BenchmarkAdaptSchema/ref_dedup/gemini-8 246443151 4.970 ns/op 0 B/op 0 allocs/op BenchmarkAdaptSchema/ref_dedup/gemini-8 191897738 5.528 ns/op 0 B/op 0 allocs/op BenchmarkFlytoMessagesToOpenAI/10_msgs-8 104532 10108 ns/op 4017 B/op 35 allocs/op BenchmarkFlytoMessagesToOpenAI/10_msgs-8 125684 9284 ns/op 4017 B/op 35 allocs/op BenchmarkFlytoMessagesToOpenAI/10_msgs-8 143625 8838 ns/op 4017 B/op 35 allocs/op BenchmarkFlytoMessagesToOpenAI/50_msgs-8 29578 44894 ns/op 18871 B/op 157 allocs/op BenchmarkFlytoMessagesToOpenAI/50_msgs-8 31526 43043 ns/op 18870 B/op 157 allocs/op BenchmarkFlytoMessagesToOpenAI/50_msgs-8 27792 43199 ns/op 18870 B/op 157 allocs/op BenchmarkFlytoMessagesToOpenAI/100_msgs-8 14422 81118 ns/op 38462 B/op 308 allocs/op BenchmarkFlytoMessagesToOpenAI/100_msgs-8 14972 81613 ns/op 38462 B/op 308 allocs/op BenchmarkFlytoMessagesToOpenAI/100_msgs-8 13198 91567 ns/op 38462 B/op 308 allocs/op BenchmarkFlytoMessagesToGemini/10_msgs-8 346519 3057 ns/op 1792 B/op 15 allocs/op BenchmarkFlytoMessagesToGemini/10_msgs-8 349612 2986 ns/op 1792 B/op 15 allocs/op BenchmarkFlytoMessagesToGemini/10_msgs-8 442322 3064 ns/op 1792 B/op 15 allocs/op BenchmarkFlytoMessagesToGemini/50_msgs-8 96376 12730 ns/op 8192 B/op 57 allocs/op BenchmarkFlytoMessagesToGemini/50_msgs-8 84151 12647 ns/op 8192 B/op 57 allocs/op BenchmarkFlytoMessagesToGemini/50_msgs-8 87717 13036 ns/op 8192 B/op 57 allocs/op BenchmarkFlytoMessagesToGemini/100_msgs-8 46818 24257 ns/op 16736 B/op 108 allocs/op BenchmarkFlytoMessagesToGemini/100_msgs-8 46832 24623 ns/op 16736 B/op 108 allocs/op BenchmarkFlytoMessagesToGemini/100_msgs-8 55202 26896 ns/op 16736 B/op 108 allocs/op PASS ok flyto-agent/internal/wire 42.496s