gpuweb / cts

WebGPU Conformance Test Suite
https://gpuweb.github.io/cts/
BSD 3-Clause "New" or "Revised" License
123 stars 74 forks source link

Optimize input data generation #1757

Open austinEng opened 1 year ago

austinEng commented 1 year ago

In profiles taken while running the CTS, I found that data generation can take a large majority of the test time - often 70-80% for some tests! For example, methods like:

These make ArrayBuffer allocations, so we should probably do a similar optimization that @toji did in #1583. The tests generally just need some arbitrary data, so we can have some allocator function which returns to the test an offset into some previously-allocated and initialized buffer of data.

cc @kainino0x

toji commented 1 year ago

Worked on this today. WIP patch is in #1787

Drops copyTextureToTexture tests from 71s to 20s on my machine.