You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Importing gitgalaxy.galaxyscope takes ~3 s, 2.5 s of it compiling every language's regexes up front #3914
python -X importtime -c "import gitgalaxy.galaxyscope" on Linux reports 3.2 s in total:
Module
Cumulative import time
Self time
gitgalaxy.standards.language_standards
2.50 s
languages.dart
0.26 s
_shared_patterns
0.23 s
languages.powershell
0.20 s
gitgalaxy.core.detector (own time)
0.20 s
Why it matters
Every process that scans pays it:
every galaxyscope run, including a one-file scan whose extraction takes 0.06 s;
under the spawn start method (Windows, macOS), every extraction worker as well.
The test suite runs about 150 scans, so the suite pays this cost O(scans) times. The companion fix removes the per-worker share for small scans, but not the per-process one.
Directions
Compile each language's rules lazily, on the first file of that language: a COBOL estate never needs dart's patterns.
Or keep the definitions as source strings until a StructuralExtractor is built for that language.
Either way, measure with -X importtime before and after, and keep the golden masters byte-identical.
Claude/fork precompile #3931: pre-compiles the scan's languages in the parent before a fork, memoises compiled rules per extractor, and adds a whole-command process metric to phase_ab.
Activity
#3913: Full Suite Gate out of its timeout: small scans skip the worke…
#3914: compile the language registry's rules on first use, not at imp…
Claude/fork precompile (#3931)
squid-protocol commentedon Sep 27, 2026
Where this landed.
The change took three PRs:
processmetric tophase_ab.End state, measured with
phase_abagainst main before #3923, as whole-command time:The deterministic outputs and the golden masters are identical. Details and caveats are on #3929.
Generated by Claude Code
#3914: ReDoS harnesses send their child a plain compiled pattern
#3929: pre-compile before a fork only for scans of 500+ files (small …
squid-protocol commentedon Sep 27, 2026
Closing as done. #3923, #3931 and #3939 are all merged.
The full numbers are in the comment above and on #3929.
Generated by Claude Code