icykoneko / ff14-fish-tracker-app

FF14 Fish Tracker App
https://ff14fish.carbuncleplushy.com
MIT License
61 stars 21 forks source link

Upcoming Windows UI is lagging start up #105

Closed icykoneko closed 2 years ago

icykoneko commented 2 years ago

After a lot more careful profiling, it appears the code that sets up the upcoming windows modal UI elements is to blame for a significant portion of the initial load times, almost 66% of it! This is caused by every fish generating the DOM elements for the upcoming windows element, and then running the initialization code which calculates layout sizes.

Unfortunately, Semantic UI doesn't provide any good solution for this outside of some very decoupled state information... There's a community supported project, Formantic UI which has made improvements to the Model module that look like they would solve the problem.

Before that though, while this code is most certainly a main issue for initial load, the design is also potentially slowing down updates since they are updating DOM elements that may never even get displayed. The existing APIs provide a hook to run code before displaying the modal, so the formatting of information ought to be done when the user clicks the button, not before. This will probably cause the modal to display a little later, but I think it will improve load, and update times overall, so it's a fair trade-off.