Skip to content

Optimize resource reload - #70

Merged
ABKQPO merged 3 commits into
masterfrom
optimize-resource-reload
Sep 5, 2026
Merged

Optimize resource reload#70
ABKQPO merged 3 commits into
masterfrom
optimize-resource-reload

Conversation

@danyadev

@danyadev danyadev commented Sep 5, 2026

Copy link
Copy Markdown
Member

Summary

The old flow first built a content manifest by walking and hashing all relevant files, then walked the same directories again to build GuideNH indexes.

The new flow scans directory packs once and builds the indexes directly. ZIP packs keep their cheap size/mtime-based cache, while directory packs are always rescanned because validating their old cache was more expensive than rebuilding the indexes. Markdown files are also only read far enough to parse the leading frontmatter needed for loadPriority, instead of reading the full page during indexing.

The resource-pack traversal is now isolated in GuideResourcePackScanner, while DataDrivenGuideLoader only handles cache orchestration and applying scan results to GuideNH indexes.

DataDrivenGuideLoader.scanAndBuildAll             ~931 ms → ~190 ms
│
├─ GuideResourcePackScanner.scanDirectoryPack     ~347 ms → ~22 ms
│  └─ collectNamespaceLangPaths                   ~345 ms → ~18 ms
│
├─ GuideResourcePackScanner.scanZipPack                     ~128 ms
│
├─ GuideBuilder.build                                       ~28 ms
├─ apply/index/misc                                         ~12 ms
│
└─ ResourcePackContentManifest.capture            ~430 ms → removed
   └─ contentChecksum                             ~377 ms → removed
Before After
reload 1277ms reload 554ms
image image

Checklist

  • I have tested this PR in DevEnv
  • I have tested this PR in Fullpack
  • This PR is in compliance with the GTNH AI Policy
  • This PR requires another PR in order to merge

@danyadev
danyadev requested a review from ABKQPO September 5, 2026 15:43
@ABKQPO
ABKQPO merged commit 35a82c8 into master Sep 5, 2026
1 check passed
@ABKQPO
ABKQPO deleted the optimize-resource-reload branch September 5, 2026 16:52
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.

2 participants