Skip to content

improved loadtime of crossover selection

SigmaHyperon requested to merge SigmaHyperon/scryer:crossover-loadtime into master

I improved the time it takes to load the new characters after selecting a crossover fandom. Right now this is done by loading the characterlist via Ajax and then inserting each option into each select box individually.

So whenever you select "All Crossovers" a total of ~10000 characters get inserted into the DOM 4 times. On my main machine that takes about 7 seconds during which the pagecontent is entirely unresponsive. On my Tablet thats a bit older, which i use to read, it regularly crashes Chrome.

Since scryer has a reasonably up-to-date JQuery included, I rewrote that behavior, so that the entire list only gets generated once, and the is inserted into the DOM with Jquery's append(), which effectively cuts down the total number of DOM refreshes from ~40k to just 4, since append supports passing in arrays of elements, which then get added in a single transaction.

This cut down the loadtime to ~580ms for me:crossover-select-timing

Merge request reports