Skip to content

Commit

Permalink
Merge pull request #422 from missinglink/wkb_unmarshal_bench
Browse files Browse the repository at this point in the history
wkb: add benchmarking script
  • Loading branch information
peterstace committed Nov 6, 2022
2 parents 34b2d26 + 156a231 commit 6e6c98a
Show file tree
Hide file tree
Showing 2 changed files with 383 additions and 360 deletions.
21 changes: 21 additions & 0 deletions geom/wkb_bench_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package geom_test

import (
"strconv"
"testing"

"github.com/peterstace/simplefeatures/geom"
)

func BenchmarkWKBParse(b *testing.B) {
for i, tt := range validWKBCases {
b.Run(strconv.Itoa(i), func(b *testing.B) {
for n := 0; n < b.N; n++ {
_, err := geom.UnmarshalWKB(hexStringToBytes(b, tt.wkb), geom.DisableAllValidations)
if err != nil {
panic(err)
}
}
})
}
}

0 comments on commit 6e6c98a

Please sign in to comment.