Reduce use of binary.Read and, by extention, reflection
This commit is contained in:
@@ -68,6 +68,26 @@ func TestMisc(t *testing.T) {
|
||||
// t.Fatal("UM")
|
||||
}
|
||||
|
||||
func BenchmarkExtract(b *testing.B) {
|
||||
tmpDir := "testing"
|
||||
fil, err := preTest(tmpDir)
|
||||
if err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
libPath := filepath.Join(tmpDir, "ExtractLib")
|
||||
os.RemoveAll(libPath)
|
||||
op := FastOptions()
|
||||
op.IgnorePerm = true
|
||||
rdr, err := NewReader(fil)
|
||||
if err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
err = rdr.ExtractWithOptions(libPath, op)
|
||||
if err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkRace(b *testing.B) {
|
||||
tmpDir := "testing"
|
||||
fil, err := preTest(tmpDir)
|
||||
|
||||
Reference in New Issue
Block a user