Files
dingtalk-workspace-cli/internal/cli/catalogcodegen/probe_bench_test.go
T
玉澜andCursor 53816b3d33 fix(schema): drop retired Hint dead code and harden CI coverage shards
Remove manual_hints/Hint* leftovers after declare-or-annotate delivery, and fix macOS auth scoping plus Windows/.exe TestMain and race shard packaging so platform coverage gates stay reliable.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-02 13:21:15 +08:00

27 lines
737 B
Go

// Copyright 2026 Alibaba Group
// Licensed under the Apache License, Version 2.0 (the "License");
package catalogcodegen_test
import (
"testing"
"github.com/DingTalk-Real-AI/dingtalk-workspace-cli/internal/cli/catalogcodegen"
)
// BenchmarkGoLiteralAccess measures reaching a tool in the compiled-in map. The
// data is static, so this is a map lookup with no decode and no allocation —
// the cost model internal/shortcut already gets.
func BenchmarkGoLiteralAccess(b *testing.B) {
if len(catalogcodegen.Tools) == 0 {
b.Fatal("no generated tools")
}
b.ReportAllocs()
for i := 0; i < b.N; i++ {
tool, ok := catalogcodegen.Tools["dev.delete_dev_app"]
if !ok || tool.CLIPath == "" {
b.Fatal("lookup missed")
}
}
}