delve/pkg/dwarf/frame/parser_test.go
Derek Parker 4c9a72e486 *: Update import name to github.com/go-delve/delve
The repository is being switched from the personal account
github.com/derekparker/delve to the organization account
github.com/go-delve/delve. This patch updates imports and docs, while
preserving things which should not be changed such as my name in the
CHANGELOG and in TODO comments.
2019-01-04 19:43:13 +01:00

31 lines
485 B
Go

package frame_test
import (
"encoding/binary"
"io/ioutil"
"os"
"testing"
"github.com/go-delve/delve/pkg/dwarf/frame"
"github.com/pkg/profile"
)
func BenchmarkParse(b *testing.B) {
defer profile.Start(profile.CPUProfile).Stop()
f, err := os.Open("testdata/frame")
if err != nil {
b.Fatal(err)
}
defer f.Close()
data, err := ioutil.ReadAll(f)
if err != nil {
b.Fatal(err)
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
frame.Parse(data, binary.BigEndian, 0)
}
}