Skip to content

Commit

Permalink
wasm: update benchmark to use url instead of path (#3001)
Browse files Browse the repository at this point in the history
Signed-off-by: Edoardo Vacchi <[email protected]>
Signed-off-by: Alessandro (Ale) Segala <[email protected]>
Co-authored-by: Alessandro (Ale) Segala <[email protected]>
  • Loading branch information
evacchi and ItalyPaleAle authored Jul 20, 2023
1 parent d067c13 commit 22a695c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions middleware/http/wasm/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion state/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down

0 comments on commit 22a695c

Please sign in to comment.