MCPcopy Create free account
hub / github.com/beeker1121/goque / BenchmarkStackPush

Function BenchmarkStackPush

stack_test.go:591–606  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

589}
590
591func BenchmarkStackPush(b *testing.B) {
592 // Open test database
593 file := fmt.Sprintf("test_db_%d", time.Now().UnixNano())
594 s, err := OpenStack(file)
595 if err != nil {
596 b.Error(err)
597 }
598 defer s.Drop()
599
600 b.ResetTimer()
601 b.ReportAllocs()
602
603 for n := 0; n < b.N; n++ {
604 _, _ = s.PushString("value")
605 }
606}
607
608func BenchmarkStackPop(b *testing.B) {
609 // Open test database

Callers

nothing calls this directly

Calls 3

OpenStackFunction · 0.85
PushStringMethod · 0.80
DropMethod · 0.45

Tested by

no test coverage detected