MCPcopy Index your code
hub / github.com/devaccuracy/ledgerforge / BenchmarkConfigFetch

Function BenchmarkConfigFetch

transaction_benchmark_test.go:113–124  ·  view source on GitHub ↗

BenchmarkConfigFetch measures the overhead of calling config.Fetch() repeatedly This represents the OLD approach before our optimization

(b *testing.B)

Source from the content-addressed store, hash-verified

111// BenchmarkConfigFetch measures the overhead of calling config.Fetch() repeatedly
112// This represents the OLD approach before our optimization
113func BenchmarkConfigFetch(b *testing.B) {
114 setupBenchmarkConfig()
115
116 b.ResetTimer()
117 for i := 0; i < b.N; i++ {
118 cfg, err := config.Fetch()
119 if err != nil {
120 b.Fatal(err)
121 }
122 _ = cfg.Transaction.LockDuration
123 }
124}
125
126// BenchmarkConfigCached measures direct config access
127// This represents the NEW approach after our optimization

Callers

nothing calls this directly

Calls 3

FetchFunction · 0.92
setupBenchmarkConfigFunction · 0.85
FatalMethod · 0.45

Tested by

no test coverage detected