Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): Add conference links related to wzprof #106

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ you might enjoy reading:

👉 [**Performance in the spotlight: WebAssembly profiling for everyone**](https://blog.stealthrocket.tech/performance-in-the-spotlight-webassembly-profiling-for-everyone)

We have presented this project at international conferences, such as:

- **[Civo Navigate Europe 2024](https://www.youtube.com/watch?v=9fxMbaHSSiI)**
> slides: [https://github.com/iamrajiv/civo-navigate-europe-2024](https://github.com/iamrajiv/civo-navigate-europe-2024)
- **[KubeCon + CloudNativeCon India 2024](https://www.youtube.com/watch?v=LaQZVxOixGY)**
> slides: [https://github.com/iamrajiv/kubecon-cloudnativecon-india-2024](https://github.com/iamrajiv/kubecon-cloudnativecon-india-2024)

## Motivation

WebAssembly runtimes typically allow profiling guest code via an external
Expand Down Expand Up @@ -50,20 +57,23 @@ You can either use `wzprof` as a CLI or as a library if you use the Wazero
runtime libraries.

To install the latest version of `wzprof`:

```sh
go install github.com/stealthrocket/wzprof/cmd/wzprof@latest
```

To use the library as code in a Go program:

```sh
go get github.com/stealthrocket/wzprof@latest
```

### Sampling
### Sampling

By default, wzprof will sample calls with a ratio of 1/19. Sampling is used to
limit the overhead of the profilers but the default rate might not be suitable
in some cases.
For example, if your processes are short running and you don't see anything in the
limit the overhead of the profilers but the default rate might not be suitable
in some cases.
For example, if your processes are short running and you don't see anything in the
profile, you might want to disable the sampling. To do so, use `-sample 1`.

### Run program to completion with CPU or memory profiling
Expand All @@ -74,9 +84,11 @@ test programs complete quickly.
```sh
wzprof -sample 1 -memprofile /tmp/profile ./testdata/c/simple.wasm
```

```sh
wzprof -sample 1 -cpuprofile /tmp/profile ./testdata/c/crunch_numbers.wasm
```

```sh
go tool pprof -http :4000 /tmp/profile
```
Expand All @@ -89,16 +101,18 @@ can expose a pprof-compatible http endpoint on behalf of the guest application:
```sh
wzprof -pprof-addr :8080 ...
```

```sh
go tool pprof -http :3030 'http://localhost:8080/debug/pprof/profile?seconds=5'
```

```sh
go tool pprof -http :3030 'http://localhost:8080/debug/pprof/heap'
```

## Profilers

⚠️ The `wzprof` Go APIs depend on Wazero's `experimental` package which makes no
⚠️ The `wzprof` Go APIs depend on Wazero's `experimental` package which makes no
guarantees of backward compatilbity!

The following code snippet demonstrates how to integrate the profilers to a
Expand Down Expand Up @@ -218,7 +232,6 @@ you please file an issue in the github tracker.

[timecraft-python]: https://docs.timecraft.dev/getting-started/prep-application/compiling-python#preparing-python


### DWARF (C, Rust, Zig...)

As a fallback, if DWARF sections are available, wzprof symbolizes the wasm stack
Expand Down
Loading