github.com/bananabytelabs/wazero@v0.0.0-20240105073314-54b22a776da8/internal/integration_test/bench/decoder_bench_test.go (about) 1 package bench 2 3 import ( 4 "testing" 5 6 "github.com/bananabytelabs/wazero/api" 7 "github.com/bananabytelabs/wazero/internal/wasm" 8 "github.com/bananabytelabs/wazero/internal/wasm/binary" 9 ) 10 11 func BenchmarkCodec(b *testing.B) { 12 b.Run("binary.DecodeModule", func(b *testing.B) { 13 b.ReportAllocs() 14 for i := 0; i < b.N; i++ { 15 if _, err := binary.DecodeModule(caseWasm, api.CoreFeaturesV2, wasm.MemoryLimitPages, false, false, false); err != nil { 16 b.Fatal(err) 17 } 18 } 19 }) 20 }