Load the online mod list from a flat summary table#2192
Open
ethangreen-dev wants to merge 2 commits into
Open
Conversation
getPackagesAsThundersstoreMods (great name) scanned the full packages table, forcing indexdb to deserialize every version[] (like 188k in total, about 310MB on lethal-company) just to build a flat per-package list. Add a summaries table that holds only the fields the list needs. The list read scans it and ignores versions[], while keyed lookups still work the same way. lethal-company my benchmarks report a cold read from ~2.5s to ~0.5s and peak allocation reduction from ~400MB to ~25MB.
markRaw makes state.mods a non-reactive object, so ImportProfileModal watching the array directly becomes an invalid, inert watch source. Watch a getter instead, which fires on the wholesale reassignment that a mod list refresh performs.
45b68ea to
9467639
Compare
ebkr
approved these changes
Jun 8, 2026
| .sort(ThunderstoreMod.defaultOrderComparer); | ||
| let summaries = await db.summaries.where({community}).toArray(); | ||
|
|
||
| if (!summaries.length) { |
Owner
There was a problem hiding this comment.
This should be a length comparison - a boolean check whilst valid is incorrect comprehension vs just an assertion to 0
Comment on lines
+160
to
+162
| // The mod list is large and immutable, replaced wholesale. | ||
| // markRaw keeps Vue from deep-proxying every entry, which absolutely dominates | ||
| // the load memory and time complexity. |
Owner
There was a problem hiding this comment.
I think you'll find this has a large impact only in VueX development mode.
If you go to store/index.ts, and turn off strict mode, does this actually make much of a difference?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The what?
getPackagesAsThunderstoreMods (great name) scanned the full packages table, forcing indexdb to deserialize every version[] (like 188k in total, about 310MB on lethal-company) just to build a flat per-package list. This caused insane slowdowns at launch, especially for users on underpowered PCs. Also the memory usage was just bad.
The fix?
Add a summaries table that holds only the fields the list needs. The list read scans it and ignores versions[], while keyed lookups still work the same way.
The performance?
The lethal-company index, as reported by my benchmarks, had a cold read time reduction from ~2.5s to ~0.5s and peak allocation reduction from ~400MB to ~25MB.