dbvideostriketeam / wubloader

MIT License
15 stars 8 forks source link

thrimshim: use send_file to serve templates from database #461

Closed dcollinsn closed 2 weeks ago

dcollinsn commented 2 weeks ago

I don't claim to understand why this works, but this makes downloading the thumbnail templates (to preview on the thumbnail management page, or to select the "hole" in the advanced crop settings in the editor) way faster. Something to do with how flask is chunking the memoryview object to serve.

Applying this changed the timings to download "fiddling.png" from 818ms waiting and 6770ms receiving, to 777ms waiting and 14ms receiving.

Resolves #458

chrusher commented 2 weeks ago

It will not spot all Python bugs but running a linter such as Pyflakes before pushing is good practice.

dcollinsn commented 2 weeks ago

ekim has a better fix (bytes(image) apparently is enough), closing