4 ms·
Works well in Chrome, but gets bog slow in Safari (10 beta). Instruments shows that it spends an enormous amount of time in memcpy copying IOSurface data aroun
by comex 10y ago
Works well in Chrome, but gets bog slow in Safari (10 beta). Instruments shows that it spends an enormous amount of time in memcpy copying IOSurface data around; I wonder why it is happening on the CPU rather than the GPU. But it may not be entirely Safari's fault: it appears that every single organism first gets drawn to a canvas the size of the entire screen (as opposed to the size necessary for the organism), then that canvas gets drawImage'd to the main canvas. That's an enormous number of wasted pixels. Also, this seems to happen fresh every frame: I don't know why they're using an intermediate image in the first place, but it's not for caching.