Profiling WebAssembly with pprof and wzprof

10th September 2024

Rajiv Ranjan Singh

Agenda

2

Speaker - Rajiv Ranjan Singh

3

What is Go?

4

Profiling with pprof

5

What is WebAssembly?

6

Profiling WebAssembly with wzprof

7

CPU and Memory profiling with wzprof

8

Generate profilers using wzprof

package main

import "fmt"

func main() {
    fmt.Println("Hello wzprof!")
}
GOOS=wasip1 GOARCH=wasm go build -o main.wasm main.go
wzprof -sample 1 -memprofile /Users/rajiv.singh/Desktop/hello-wasm/memprofile.out ./main.wasm
wzprof -sample 1 -cpuprofile /Users/rajiv.singh/Desktop/hello-wasm/cpuprofile.out ./main.wasm
9

Visualize the memory profile

go tool pprof -http :4001 memprofile.out
10

Visualize the cpu profile

go tool pprof -http :6002 cpuprofile.out
11

Future of profiling WebAssembly with wzprof

12

Thank you

Rajiv Ranjan Singh

Use the left and right arrow keys or click the left and right edges of the page to navigate between slides.
(Press 'H' or navigate to hide this message.)