Viceroy icon indicating copy to clipboard operation
Viceroy copied to clipboard

Provide a way to set the interval for samples when profiling

Open katef opened this issue 1 year ago • 1 comments

Currently the sample frequency for profiling in Viceroy is hardcoded to 50µs. For our purposes we don't need the frequency to be so low that performance is unaffected, but we do need it to be high enough to report on small things. Setting it as a CLI option seems reasonable to me.

wasmtime provides --profile=guest[,path[,interval]] which allows setting the interval between samples for profiling: https://github.com/bytecodealliance/wasmtime/blob/main/docs/examples-profiling-guest.md?plain=1#L7-L11:

To use this profiler with the Wasmtime CLI, pass the --profile=guest[,path[,interval]] flag.

  • path is where to write the profile, wasmtime-guest-profile.json by default
  • interval is the duration between samples, 10ms by default

I think it'd make sense to match this, Viceroy already has similar syntax for its --profile cli flag.

katef avatar Dec 19 '23 20:12 katef