3 ms·
That could be the case yes, still I feel it should be better, let me do a quick test as I have some spare time.
by moralestapia 5y ago
That could be the case yes, still I feel it should be better, let me do a quick test as I have some spare time.
- seedgou 5y agoThe rendering logic is in `src/utils/pdf/renderPage.ts` and has only 26 lines.
- moralestapia 5y agoHere's a very naive blur implementation (which is your most expensive operation there), https://codepen.io/almosnow/pen/abEXBZP?editors=0011 https://codepen.io/almosnow/pen/abEXBZP?editors=0011 (at the end of the blur pass it prints the elapsed time to the console) You're right, it does get kind of slow at 2x, but not that slow, on my laptop it takes around 1 sec/page, while on your site takes 20-30 secs/page. Also, my very naive code does not take into account "warming up" and some other code optimizations to make the blur much faster, you could easily get it down to 100ms/page, I'm sure! Best luck!
- seedgou 5y agoOh! You mean the scanning speed. I thought you was talking about the original PDF preview. For now, scanning is using emscriptened ImageMagick Wasm. Due to the translation from C++ to Wasm, the scanning speed is very slow. Maybe re-writing blur, rotate and noise algorithm will speed up the scanning.
- hobo_mark 5y agoAh, wasm... The site managed to almost kill my machine until the tab committed OOM suicide, I guess this explains why.