Skip to content

Commit

Permalink
Fix benchmark, see #334
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed Feb 2, 2025
1 parent 24ed619 commit 740de25
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ func TestPathLengthParametrization(t *testing.T) {
}

func BenchmarkToRasterizer(b *testing.B) {
res := DPMM(1.0)
res := DPMM(0.5)
data, err := os.ReadFile("resources/netherlands.path")
if err != nil {
panic(err)
Expand Down Expand Up @@ -985,7 +985,7 @@ func BenchmarkToRasterizer(b *testing.B) {
}

func BenchmarkToScanx(b *testing.B) {
res := DPMM(1.0)
res := DPMM(0.5)
data, err := os.ReadFile("resources/netherlands.path")
if err != nil {
panic(err)
Expand All @@ -1003,7 +1003,7 @@ func BenchmarkToScanx(b *testing.B) {
scanner := scanx.NewScanner(spanner, int(w), int(h))

scanner.SetColor(image.Black)
p.ToScanx(scanner, h*float64(res), res)
p.ToScanx(scanner, h, res)
scanner.Draw()

f, _ := os.Create("ToScanx.png")
Expand All @@ -1013,7 +1013,7 @@ func BenchmarkToScanx(b *testing.B) {
b.ResetTimer()
for i := 0; i < b.N; i++ {
scanner.Clear()
p.ToScanx(scanner, h*float64(res), res)
p.ToScanx(scanner, h, res)
scanner.Draw()
}
}

0 comments on commit 740de25

Please sign in to comment.