mirror of
https://github.com/wazero/wazero
synced 2026-06-21 14:12:37 +00:00
d3c5e8655f
This adds benchmarks from lib sodium, but the results are hard to interpret. We may need to recompile them using zig so that we can export a function instead of using WASI to do it. Right now, we can't really see performance of functions because other runtimes aren't designed to re-instantiate like ours. This only compares against wasmtime as that's the only runtime besides ours that is safe to re-instantiate. Signed-off-by: Adrian Cole <adrian@tetrate.io>
50 lines
894 B
Go
50 lines
894 B
Go
package compiler
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/tetratelabs/wazero/internal/integration_test/vs"
|
|
)
|
|
|
|
var runtime = vs.NewWazeroCompilerRuntime
|
|
|
|
func TestAllocation(t *testing.T) {
|
|
vs.RunTestAllocation(t, runtime)
|
|
}
|
|
|
|
func BenchmarkAllocation(b *testing.B) {
|
|
vs.RunBenchmarkAllocation(b, runtime)
|
|
}
|
|
|
|
func TestFactorial(t *testing.T) {
|
|
vs.RunTestFactorial(t, runtime)
|
|
}
|
|
|
|
func BenchmarkFactorial(b *testing.B) {
|
|
vs.RunBenchmarkFactorial(b, runtime)
|
|
}
|
|
|
|
func TestHostCall(t *testing.T) {
|
|
vs.RunTestHostCall(t, runtime)
|
|
}
|
|
|
|
func BenchmarkHostCall(b *testing.B) {
|
|
vs.RunBenchmarkHostCall(b, runtime)
|
|
}
|
|
|
|
func TestMemory(t *testing.T) {
|
|
vs.RunTestMemory(t, runtime)
|
|
}
|
|
|
|
func BenchmarkMemory(b *testing.B) {
|
|
vs.RunBenchmarkMemory(b, runtime)
|
|
}
|
|
|
|
func TestShorthash(t *testing.T) {
|
|
vs.RunTestShorthash(t, runtime)
|
|
}
|
|
|
|
func BenchmarkShorthash(b *testing.B) {
|
|
vs.RunBenchmarkShorthash(b, runtime)
|
|
}
|