Reduce use of binary.Read and, by extention, reflection

This commit is contained in:
Caleb Gardner
2025-04-10 06:26:41 -05:00
parent 4490fc3873
commit 6b0e9ef2c6
8 changed files with 75 additions and 36 deletions
+20
View File
@@ -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)