henrybetts / swift-webgpu

Swift bindings for WebGPU
MIT License
85 stars 3 forks source link

Benchmarks #4

Open stackotter opened 2 years ago

stackotter commented 2 years ago

Hi again,

I'm planning on writing some benchmarks to compare the performance of WebGPU with Metal, and I thought I should check if you already have some before I reimplement anything.

henrybetts commented 2 years ago

I haven't done any performance tests - other than a quick glance at cpu usage etc. I think Dawn does have some - but I would imagine they are aimed more at testing the impact of code changes, rather than comparing performance with other frameworks. Might still be worth having a look at.

It would be interesting to know what kind of overhead the swift library is adding on top of Dawn. There are some optimisations that could be made if it is significant enough.

stackotter commented 2 years ago

Ok, If I get the time I'll have a look into making some comparable benchmarks for Metal, swift-webgpu and Dawn. Are there any features in particular that you think would be useful to have benchmarks for?

henrybetts commented 2 years ago

I've had a brief look at the dawn performance tests. Might be worth using them as a model to some degree.

https://dawn.googlesource.com/dawn/+/refs/heads/main/docs/testing.md

Looks like there is quite a lot going on at first glance, but I think it might actually be fairly straightforward. There is one test that repeatedly uploads data to a gpu buffer, and another that repeatedly draws a triangle using different configurations (single vertex buffer vs multiple vertex buffers etc.).