Conversation
|
Would it be to expensive to just do |
The reason I'm suggesting this is because we try to avoiding adding code size overhead to the generated code, especially when its not used common cases. |
definitely expensive, if you're outputting any form of rendering, you'd run this a few hundred to a few thousand times a second, it adds up |
closure compiler would get rid of it |
|
But, are you calling From the test failures maybe closure is not able to eliminate this extra size..it looks like its adding 103 bytes to the size of the output? |
|
yes i'm also calling imagedata a lot of times, but that really can't be changed, as web doesn't provide a better way of rendering data on a canvas hm, i'm not sure how else to handle this if closure doesn't eliminate it :/ |
Have you compared the performance of you program with: vs It seems like the Also, does your program need memory growth? If not you can simply create the
|
This adds HEAPU8C for Uint8ClampedArray, alongside all the other typed arrays.
This is useful for any WASM library which renders custom image data or bitmaps to a canvas, this is because the fastest ways to paint on a canvas is via ImageData which only accepts uint8c, with this one can directly do
which is insanely fast, previously to get this functionality one needed to use pre-worker and use: