Skip to content

[HTML Report] Reduce report load time by deferring collapsed section parsing#11495

Open
hotbees wants to merge 4 commits into
simulationcraft:midnightfrom
hotbees:html-report-1
Open

[HTML Report] Reduce report load time by deferring collapsed section parsing#11495
hotbees wants to merge 4 commits into
simulationcraft:midnightfrom
hotbees:html-report-1

Conversation

@hotbees
Copy link
Copy Markdown
Contributor

@hotbees hotbees commented Jun 2, 2026

HTML reports are real heavy on HTML. A significant portion of page load time on reports (very noticably on larger ones) is spent parsing HTML and building the DOM. This can result in larger reports like the full-raid sim stack taking several seconds (perhaps an understatement depending on hardware) to fully load and be usable.

Defer section parsing

By wrapping heavy per-actor subsections in <script type="text/x-deferred-html"> blocks, we can have the browser skip parsing these sections upfront, and we can instead later inject this unparsed HTML into the DOM with a bit of JS once the section is expanded.

There's still a lot going on in an HTML report, so this doesn't completely eliminate the problem, but it does give us a report with a much faster time-to-interactive by avoiding having the browser do heavy parsing and DOM construction inside actor sections that may never be opened.

Profiling

MID1_Raid.simc report, average of 3 runs each (Chrome DevTools traces):

Metric Before After Speedup
ParseHTML 1139 ms 554 ms 2.1x
DOMContentLoaded 1789 ms 705 ms 2.5x
Load 1828 ms 707 ms 2.6x
Time to Interactive 2940 ms 1068 ms 2.8x

Where Time to Interactive is when the main thread stops being tied up by long tasks, i.e. when interactions respond without lag (~1.9 s sooner here).

Measurements were done in a Chrome incognito mode window without any extensions loaded. Certain extensions can compound on the load time and make the differences even more stark. For example, doing the same measurements (single run) in my regular browser window gives a DCL before/after of 9,926 ms / 990 ms (10x) and TTI 16,897 ms / 2,266 ms (7.5x).


Deferred sections: Abilities, Buffs, Procs/Uptimes/Benefits, Resources, Action Priority List, Statistics & Data Analysis, Stats, Gear, Profile, Talents (multi-actor reports only), Parsed Player Effects - each builds on first expand.

Other low-hanging fruit

Additionally, this addresses a couple low-hanging fruit which improve the feel of (esp. larger) reports as the page loads:

  1. Emit the raid dps chart in HTML generation. Currently, the raid dps chart isn't loaded until document ready. This is often the star of the show on large sim stacks and having it visible ASAP rather than deferring it is an easy W for usability.

  2. Emit the section-open / grouped-first / grouped-last classes in HTML on impactful sections:

    • section-open for the default-open sections (raid summary and profile sets). These are already marked by "toggle open" classes, but the section-open class which visually separates a given section from the rest isn't applied until validate_section() runs at document ready, causing a slightly jarring layout shift as the sections snap apart.
    • grouped-first for hotfixes and grouped-last for the table of contents apply the corner rounding to the separated group above the raid summary. Fairly minor but this styling also currently gets deferred until document ready and this specific group is visible in the top of the page, so it makes sense to apply them early as a mostly-correct first approximation.

For consistency, I also put section-open on the main player for single actor reports since it's also open by default and there's a noticable snap apart there.

hotbees added 3 commits June 1, 2026 21:05
render the main raid DPS chart early so that it doesn't take forever to appear on large reports. motivated by full raid sim stacks like are published on simulationcraft.org
the section-open / grouped-first / grouped-last classes that separate and round the report's sections were only applied by `validate_section()` on document.ready, causing a noticable layout shift when they snap apart on larger (longer-loading) reports.

instead, we include them directly on the sections we know will be present: section-open for the default-open sections (raid summary and profile sets), grouped-first for hotfixes and grouped-last for the table of contents. this makes the styling and layout mostly correct before document.ready, improving the feel on larger reports.
@hotbees hotbees changed the title [HTML Report] Improve load-feel (esp. on larger reports) [HTML Report] Fix some load-feel low-hanging fruit (esp. for larger reports) Jun 2, 2026
A significant portion of page load time on larger reports is spent parsing HTML and building the DOM. By enclosiong heavier per-actor subsections (Abilities, Buffs, Procs/Uptimes/Benefits, Resources, Action Priority List, Statistics & Data Analysis, Stats, Gear, Profile, Talents (multi-player only), Parsed Player Effects) in `<script type="text/x-deferred-html">` blocks, the browser will skip parsing these sections, and we can later inject this unparsed HTML into the DOM with a bit of JS once the user actually opens the section. This gives us a report which is interactive much faster by avoiding having the browser do heavy parsing work on sections that may never be opened.
@hotbees hotbees changed the title [HTML Report] Fix some load-feel low-hanging fruit (esp. for larger reports) [HTML] Improve time-to-interactive Jun 2, 2026
@hotbees hotbees changed the title [HTML] Improve time-to-interactive [HTML Report] Improve time-to-interactive Jun 2, 2026
@hotbees hotbees changed the title [HTML Report] Improve time-to-interactive [HTML Report] Reduce report load time by deferring collapsed section parsing Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant