Speed up indexing and large architecture graph loads - #41
Merged
Conversation
Prune node_modules and other skip dirs during the source walk so installed JS trees no longer dominate scan and workspace-load drift checks. Cache architecture findings at index time, batch SQLite upserts, and skip minified bundles so large graphs load without re-evaluating every rule. Co-authored-by: Damon <Modsofthenation@users.noreply.github.com>
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Modsofthenation
marked this pull request as ready for review
August 17, 2026 00:33
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.
Indexing and workspace graph loads were dominated by walking
node_modules(and other skip trees) withPath.rglob("*"), then re-running every architecture rule on eachGET /api/architecture. That is what makes a large installed JS/Django tree feel stuck on both Index and Architecture.https://github.com/Modsofthenation/grapejs-editoris not reachable from this environment (404, including with the repo token), so measurements used a synthetic 40-app Django + 40-feature React tree with ~8knode_modulesfiles — the same failure mode as an installed GrapesJS editor — plus the publicEdgeTX-DashboardsandGrapesJS/grapesjscheckouts.Measured (synthetic large monorepo)
iter_source_files)index_reposummarize_index(rules + drift)architecture_reportwithout grapharchitecture_reportwith graphSame graph size after the change: 3801 nodes / 4640 edges (architecture view 1760 / 1960). Minified
vendor.min.jsis no longer indexed.On
EdgeTX-Dashboardsandgrapesjs(nonode_modulesin the shallow clone) index stays in the ~300 ms range; architecture load drops because findings are cached.What changed
loadpath.scan): never descend intonode_modules,.git,dist,.next, etc. Used by index, detect, OpenAPI discovery, and Django boot..min.js/.bundle.js/.d.tsand files over 1 MB.findings_json). Workspace load reuses them unlessloadpath.ymlchanged.source[:pos].count("\\n"), noast.dumpfor queryset names) and O(1) route stitch by URL template.onlyRenderVisibleElementsand fewer layout passes.Tests:
tests/unit/test_index_scan.pylocks the prune/skip/cache behavior. Full unit + integration + non-Playwright e2e passed locally; UI vitest 91/91.