github.com/tetratelabs/wazero@v1.7.3-0.20240513003603-48f702e154b5/internal/integration_test/bench/decoder_bench_test.go (about) 1 package bench 2 3 import ( 4 "testing" 5 6 "github.com/tetratelabs/wazero/api" 7 "github.com/tetratelabs/wazero/internal/wasm" 8 "github.com/tetratelabs/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 }