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

Function BenchmarkCallFrameStackPushPopFixed

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

Source from the content-addressed store, hash-verified

599}
600
601func BenchmarkCallFrameStackPushPopFixed(t *testing.B) {
602 stack := newFixedCallFrameStack(256)
603
604 t.ResetTimer()
605
606 const Iterations = 256
607 for j := 0; j < t.N; j++ {
608 for i := 0; i < Iterations; i++ {
609 stack.Push(callFrame{})
610 }
611 for i := 0; i < Iterations; i++ {
612 stack.Pop()
613 }
614 }
615}
616
617// this test will intentionally not incur stack growth in order to bench the performance when no allocations happen
618func BenchmarkCallFrameStackPushPopShallowAutoGrow(t *testing.B) {

Callers

nothing calls this directly

Calls 3

newFixedCallFrameStackFunction · 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…