MCPcopy Index your code
hub / github.com/yuin/gopher-lua / BenchmarkRegistryPushPopFixed

Function BenchmarkRegistryPushPopFixed

state_test.go:733–749  ·  view source on GitHub ↗
(t *testing.B)

Source from the content-addressed store, hash-verified

731}
732
733func BenchmarkRegistryPushPopFixed(t *testing.B) {
734 al := newAllocator(32)
735 sz := 256 * 20
736 reg := newRegistry(registryTestHandler(0), sz, 0, sz, al)
737 value := LString("test")
738
739 t.ResetTimer()
740
741 for j := 0; j < t.N; j++ {
742 for i := 0; i < sz; i++ {
743 reg.Push(value)
744 }
745 for i := 0; i < sz; i++ {
746 reg.Pop()
747 }
748 }
749}
750
751func BenchmarkRegistrySetTop(t *testing.B) {
752 al := newAllocator(32)

Callers

nothing calls this directly

Calls 6

newAllocatorFunction · 0.85
registryTestHandlerTypeAlias · 0.85
LStringTypeAlias · 0.85
newRegistryFunction · 0.70
PushMethod · 0.65
PopMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…