Cache runtime version metadata fallback
This commit is contained in:
@@ -18,7 +18,19 @@ func BenchmarkPerformanceVersion(b *testing.B) {
|
||||
}
|
||||
}
|
||||
})
|
||||
b.Run("FallbackInitialization", func(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
fallback := newFallbackVersion(debug.ReadBuildInfo)
|
||||
performanceVersionSink = fallback()
|
||||
if performanceVersionSink == "" {
|
||||
b.Fatal("fallback returned an empty version")
|
||||
}
|
||||
}
|
||||
})
|
||||
b.Run("RealMetadataFallback", func(b *testing.B) {
|
||||
_ = Version()
|
||||
b.ReportAllocs()
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
|
||||
Reference in New Issue
Block a user