Checking WebGPU support...
Your browser doesn't support WebGPU. Please use one of the following browsers:
🌐
Chrome 113+
Recommended
🌊
Edge 113+
Recommended
🦊
Firefox Nightly
Flag Required
🧭
Safari 18+
macOS 14+
Run the interactive benchmark to compare GPU and CPU sorting performance on your hardware.
<iframe :src="demoSrc" class="demo-iframe" title="WebGPU Sorting Interactive Demo" allow="cross-origin-isolated" ></iframe>The demo measures:
- GPU Time: Time spent in compute shader execution
- Total Time: Including buffer upload/download and GPU execution
- CPU Time: Native JavaScript
TypedArray.sort()for comparison - Speedup: Ratio of CPU time to GPU time
| Algorithm | Best For | Complexity |
|---|---|---|
| Bitonic Sort | General purpose | O(n log²n) |
| Radix Sort | Large integers | O(n × k) |
- Close other tabs - Reduces GPU contention
- Run multiple iterations - Averages out variance
- Try different sizes - Find the crossover point for your hardware
- Compare browsers - Chrome and Edge may have different WebGPU implementations
::: info Note First run may be slower due to shader compilation. Subsequent runs will be faster due to cached pipelines. :::