wgpu icon indicating copy to clipboard operation
wgpu copied to clipboard

wgpu needs benchmarks

Open jimblandy opened this issue 1 year ago • 3 comments

We know that we need to make some key architectural changes to wgpu's resource management, but wgpu's performance is a key selling point, and it's difficult to assess the impact of the changes we're considering without having benchmarks at hand.

The ideal would be something in CI, but we're sort of at zero right now, and we need some way to answer engineering questions. The benchmarks could be informal, require manual steps, be microbenchmarks, require use of external tools like Tracy - all would be a step forward.

jimblandy avatar Mar 27 '24 16:03 jimblandy

To add to this, (iirc) when profiling Bevy we've seen wgpu logging having a significant amount of overhead, even when logging is not enabled. I wanted to look into profiling this and see if I could replicate and fix it, but it's difficult to hook Bevy up to newer wgpu versions, and I ended up working on something else. Having builtin benchmarks would be very useful.

JMS55 avatar Mar 27 '24 19:03 JMS55

We could start by just including the tracing crate and putting its attribute on functions for some simple profiling.

Ideally we can get some proper benchmarks with criterion eventually. We can probably pretty easily port some of WebGPU's official benchmarks.

lylythechosenone avatar Apr 01 '24 21:04 lylythechosenone

@lylythechosenone For reference, I've hooked up wgpu to criterion here: https://github.com/FL33TW00D/wgpu-bench/blob/master/src/lib.rs#L165

FL33TW00D avatar Apr 12 '24 10:04 FL33TW00D