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
MERGEABLEloadPosterFrame 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:
1339-new-board-performance (thumbnail and posterframe saved only on board exit)
1339-new-board-performance-tweaks (misc fixes)
into a single 1339-new-board-performance-merged-fixes
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
usefs.existsSync
to check image file exists, fail immediately if not found. Extra filesystem access, but faster than waiting fornew Image
to return an error. (in1339-new-board-performance-tweaks
)In
loadSketchPaneLayers
, theyield CAF.delay(signal, 1)
appears to be slower than expected, and variable duration. Might not be necessary (especially for the single new board case). (in1339-new-board-performance-tweaks
)renderFakePosterFrame
could cache generated canvas for re-use. (in1339-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:
1339-new-board-performance-merged-fixes