wasm: update benchmark to use `url` instead of `path` (#3001)

Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
This commit is contained in:
Edoardo Vacchi 2023-07-20 17:50:58 +02:00 committed by GitHub
parent d067c13350
commit 22a695c745
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -28,19 +28,19 @@ func BenchmarkNative(b *testing.B) {
}
func BenchmarkTinygo(b *testing.B) {
path := "./internal/e2e-guests/rewrite/main.wasm"
path := "file://internal/e2e-guests/rewrite/main.wasm"
benchmarkMiddleware(b, path)
}
// BenchmarkWat gives baseline performance for the same handler by
// writing it directly in WebAssembly Text Format.
func BenchmarkWat(b *testing.B) {
path := "./internal/testdata/rewrite.wasm"
benchmarkMiddleware(b, path)
url := "file://internal/testdata/rewrite.wasm"
benchmarkMiddleware(b, url)
}
func benchmarkMiddleware(b *testing.B, path string) {
md := metadata.Base{Properties: map[string]string{"path": path}}
md := metadata.Base{Properties: map[string]string{"url": path}}
l := logger.NewLogger(b.Name())
l.SetOutput(io.Discard)

View File

@ -17,7 +17,7 @@ import (
"github.com/dapr/components-contrib/state/query"
)
// GetRequest is the object describing a state fetch request.
// GetRequest is the object describing a state "fetch" request.
type GetRequest struct {
Key string `json:"key"`
Metadata map[string]string `json:"metadata"`