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

Function BenchmarkCallFrameStackPushPopShallowAutoGrow

state_test.go:618–632  ·  view source on GitHub ↗

this test will intentionally not incur stack growth in order to bench the performance when no allocations happen

(t *testing.B)

Source from the content-addressed store, hash-verified

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) {
619 stack := newAutoGrowingCallFrameStack(256)
620
621 t.ResetTimer()
622
623 const Iterations = 8
624 for j := 0; j < t.N; j++ {
625 for i := 0; i < Iterations; i++ {
626 stack.Push(callFrame{})
627 }
628 for i := 0; i < Iterations; i++ {
629 stack.Pop()
630 }
631 }
632}
633
634func BenchmarkCallFrameStackPushPopShallowFixed(t *testing.B) {
635 stack := newFixedCallFrameStack(256)

Callers

nothing calls this directly

Calls 3

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…