art with code

2009-03-21

More Canvas 3D tests, preliminary bandwidth benchmark

Back to the test-writing circuit, today brings tests for texSubImage2D, texSubImage2DHTML, copyTexImage2D and copyTexSubImage2D.

Also, wrote a small bandwidth micro-benchmark to measure texture upload bandwidth and vertex upload bandwidth. And some "drawing" tests that don't draw anything. Which makes them ever-so-slightly useless. I wrote C versions of some of the benchmarks too, to have a baseline to compare to.

Here are the preliminary results (you should take these with a huge dose of salt, it's more than likely that I'm Just Doing It Wrong):

  • texImage2D bandwidth: C 1.2 GB/s, JS 200 MB/s, JS with floats in the array 20 MB/s

  • texSubImage2D bandwidth: C 1.2 GB/s, JS 200 MB/s

  • texImage2DHTML bandwidth: JS 85 MB/s (I kinda hobbled that by removing the single optimization it had.)

  • readPixels bandwidth: JS 18 MB/s

  • getImageData bandwidth: JS 22 MB/s

  • bufferData bandwidth: C 3.5 GB/s, JS 211 MB/s



The vertex "drawing" numbers I got were around 65-100 million vertices per second. The anomalously slow one was drawing in JavaScript with vertex arrays and swapping the array after each draw, as it had to convert the JS array into a C array. And that was taking around 1ms for every fifty thousand floats. So in JS, you really should use VBOs for performance.

No comments:

Blog Archive