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
### Module graph construction is now 3000x faster! 🚀
4
+
5
+
Dramatically improved module graph build performance through two key optimizations:
6
+
7
+
**Before:**~1850ms to analyze `build.zig` (loading 308 modules from std with ZIR)
8
+
**After:**~0.6ms to analyze `build.zig` (loading 2 modules without ZIR)
9
+
10
+
**What changed:**
11
+
12
+
1.**Disabled ZIR generation** - ZIR was added proactively in v0.4.0 for future control flow analysis (issue #18), but no rules currently use it. Generating ZIR took 10-50ms per module.
13
+
14
+
2.**Skip recursing into std library** - When linting user code like `build.zig`, we don't need to parse all 300+ modules from the standard library. Now we only load the root `std.zig` file.
15
+
16
+
**Impact on real-world usage:**
17
+
18
+
```bash
19
+
# Linting a single file that imports std
20
+
Before: ~2 seconds
21
+
After: ~0.4 seconds (5x faster)
22
+
23
+
# Linting entire src/ directory
24
+
Before: Previously slow on large projects
25
+
After: Dramatically faster startup and analysis
26
+
```
27
+
28
+
These optimizations can be easily reverted if control flow analysis is implemented in the future (see well-documented code comments in `src/ModuleGraph.zig`).
29
+
30
+
## Technical Details
31
+
32
+
- ZIR generation infrastructure remains in place and can be re-enabled by uncommenting documented code sections
33
+
- Module graph now loads only user code + top-level std.zig instead of recursively parsing the entire standard library
34
+
- All tests pass; linter functionality unchanged
35
+
- Verified against GitHub history: ZIR added in commit 14bbe87 but never used by any rules
36
+
37
+
## Installation
38
+
39
+
```bash
40
+
mise use github:rockorager/ziglint@v0.5.2
41
+
```
42
+
43
+
Or download pre-built binaries from the release assets.
0 commit comments