wonderunit / storyboarder

✏️ Storyboarder makes it easy to visualize a story as fast you can draw stick figures.
https://wonderunit.com/storyboarder
3.18k stars 296 forks source link

New Board: performance #1339

Open audionerd opened 6 years ago

audionerd commented 6 years ago

To improve initial performance, we could skip posterframe and thumbnail generation which usually happens in the new board command. They would generate later (once a single layer is dirtied).

Postpone thumbnail gen If the user creates one or more new boards without drawing on them, layers aren't dirtied, and the thumbnails will not be created. This will cause a warning message the next time the project is opened. So saveImageFile will have to be modified to check for a thumbnail file and write one if it doesn't exist. ~NOTE: this causes problems with Scene Timeline which renders a broken image icon because thumbnail is missing.~ UPDATE fixed that See: 1339-new-board-performance

Postpone Posterframe gen Posterframes will be created by loadSketchPaneLayers/renderFakePosterFrame even if no layers are dirtied. Maybe if a posterframe doesn't exist for a new board we can ignore that until we leave the board, and savePosterFrame then? This change seems pretty solid. See: 1339-new-board-performance

MERGEABLE loadPosterFrame use fs.existsSync to check image file exists, fail immediately if not found. Extra filesystem access, but faster than waiting for new Image to return an error. (in 1339-new-board-performance-tweaks)

In loadSketchPaneLayers, the yield CAF.delay(signal, 1) appears to be slower than expected, and variable duration. Might not be necessary (especially for the single new board case). (in 1339-new-board-performance-tweaks)

renderFakePosterFrame could cache generated canvas for re-use. (in 1339-new-board-performance-tweaks)

TO REVIEW: Could try running renderThumbnailDrawer immediately to display updated thumbnail. Will need to be fixed to work with undo. See: 1339-new-board-render-thumbs-first

combined:

audionerd commented 6 years ago

Partial fix in https://github.com/wonderunit/storyboarder/pull/1347

audionerd commented 5 years ago

See https://github.com/wonderunit/storyboarder/issues/1204 and https://github.com/wonderunit/storyboarder/issues/1205