PERFORMANCE

Changed some struct values from pointers to normal values for improved performance.
This commit is contained in:
Caleb Gardner
2024-07-17 09:30:16 -05:00
parent e9de9e6ad4
commit 2a33cad709
14 changed files with 74 additions and 73 deletions
+5 -4
View File
@@ -67,7 +67,7 @@ func TestMisc(t *testing.T) {
}
_ = rdr
// Put testing here
t.Fatal("UM")
// t.Fatal("UM")
}
func BenchmarkRace(b *testing.B) {
@@ -82,6 +82,7 @@ func BenchmarkRace(b *testing.B) {
os.RemoveAll(unsquashPath)
var libTime, unsquashTime time.Duration
op := squashfs.FastOptions()
op.IgnorePerm = true
start := time.Now()
rdr, err := squashfs.NewReader(fil)
if err != nil {
@@ -101,9 +102,9 @@ func BenchmarkRace(b *testing.B) {
b.Log("Unsquashfs error:", err)
}
unsquashTime = time.Since(start)
b.Log("Library took:", libTime.Round(time.Millisecond))
b.Log("unsquashfs took:", unsquashTime.Round(time.Millisecond))
b.Log("unsquashfs is", strconv.FormatFloat(float64(libTime.Milliseconds())/float64(unsquashTime.Milliseconds()), 'f', 2, 64), "times faster")
// b.Log("Library took:", libTime.Round(time.Millisecond))
// b.Log("unsquashfs took:", unsquashTime.Round(time.Millisecond))
b.Fatal("unsquashfs is", strconv.FormatFloat(float64(libTime.Milliseconds())/float64(unsquashTime.Milliseconds()), 'f', 2, 64), "times faster")
}
func TestExtractQuick(t *testing.T) {