From 226e7ca83dae33cbbe46ee600ca5b341a9ec852f Mon Sep 17 00:00:00 2001 From: warnar boekkooi Date: Sun, 1 Dec 2024 18:31:10 +0100 Subject: [PATCH] chore: add benchmark for AsFloat64Slice --- internal/attribute/attribute_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/attribute/attribute_test.go b/internal/attribute/attribute_test.go index 113b644c80e..e2c35d9706e 100644 --- a/internal/attribute/attribute_test.go +++ b/internal/attribute/attribute_test.go @@ -133,3 +133,13 @@ func BenchmarkStringSliceValue(b *testing.B) { sync = StringSliceValue(s) } } + +func BenchmarkAsFloat64Slice(b *testing.B) { + b.ReportAllocs() + var in interface{} = [2]float64{1, 2.3} + b.ResetTimer() + + for i := 0; i < b.N; i++ { + sync = AsFloat64Slice(in) + } +}