Skip to content

Conversation

@feyyy
Copy link

@feyyy feyyy commented Aug 25, 2015

I parsed 10 tiff images at Chrome to measure the performance. I look the
time spent in "parseTiff" function using chrome's profiler.

Results;
original algorithm: 7685 ms
new algorithm: 1819 ms

Differences in code;
Original algorithm was using CanvasRenderingContext2D.fillRect function
to paint the canvas. New alorithm gets the pixel byte data using
CanvasRenderingContext2D.getImageData function and put the rgba values
directly into pixel array. Finally pixel array is put back to canvas
using CanvasRenderingContext2D.putImageData function.

I parsed 10 tiff images at Chrome to measure the performance. I look the
time spent in "parseTiff" function using chrome's profiler.

results;
original algorithm: 7685 ms
new algorithm: 1819 ms

Original algorithm was using CanvasRenderingContext2D.fillRect function
to paint the canvas. New alorithm gets the pixel byte data using
CanvasRenderingContext2D.getImageData function and put the rgba values
directly into pixel array. Finally pixel array is put back to canvas
using CanvasRenderingContext2D.putImageData function.
@d-Pixie
Copy link

d-Pixie commented Feb 28, 2017

Sounds like a no-brainer merge to me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants