MCPcopy Create free account
hub / github.com/astercloud/aster / BenchmarkSimpleTokenCounter_Count

Function BenchmarkSimpleTokenCounter_Count

pkg/context/token_counter_test.go:521–529  ·  view source on GitHub ↗

Benchmark tests

(b *testing.B)

Source from the content-addressed store, hash-verified

519
520// Benchmark tests
521func BenchmarkSimpleTokenCounter_Count(b *testing.B) {
522 counter := NewGPT4Counter()
523 text := "This is a sample text for benchmarking token counting performance."
524 ctx := context.Background()
525
526 for b.Loop() {
527 _, _ = counter.Count(ctx, text)
528 }
529}
530
531func BenchmarkSimpleTokenCounter_EstimateMessages(b *testing.B) {
532 counter := NewGPT4Counter()

Callers

nothing calls this directly

Calls 2

NewGPT4CounterFunction · 0.85
CountMethod · 0.65

Tested by

no test coverage detected