marian-m12l / studio

STUdio - Story Teller Unleashed
https://marian-m12l.github.io/studio-website/
Mozilla Public License 2.0
668 stars 131 forks source link

Cache Library packs to speed up UI thread #443

Closed amorgrid closed 1 month ago

amorgrid commented 4 months ago

Library packs are read in the UI thread and with a large number of packs in the library, this causes extra delays and even exceeds vert.x thread timeout.

While a better design would be to build the library on startup, and rely on filesystem watches to keep it updated (and avoid doing these in the UI thread), this introduces a cache so that library packs read from disks are not re-read from disk for nothing. This results into a snappier experience both when accessing the library for the first time, and also on later refreshs.