Reduce running time / allocations of frame parser

This commit is contained in:
Derek Parker
2014-07-14 13:30:04 -05:00
parent 6a82ebb25d
commit c546ea2ef7
2 changed files with 21 additions and 13 deletions

View File

@ -3,6 +3,7 @@ package frame_test
import (
"testing"
"github.com/davecheney/profile"
"github.com/derekparker/dbg/dwarf/frame"
)
@ -38,3 +39,13 @@ func TestParse(t *testing.T) {
}
}
func BenchmarkParse(b *testing.B) {
defer profile.Start(profile.CPUProfile).Stop()
data := grabDebugFrameSection("../../_fixtures/testprog", nil)
b.ResetTimer()
for i := 0; i < b.N; i++ {
frame.Parse(data)
}
}