...
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 }
21
View as plain text