Skip to content

v0.5.2

Latest

Choose a tag to compare

@github-actions github-actions released this 08 Feb 11:00
· 2 commits to main since this release
v0.5.2
74db04d

Performance Improvements

Module graph construction is now 3000x faster! 🚀

Dramatically improved module graph build performance through two key optimizations:

Before: ~1850ms to analyze build.zig (loading 308 modules from std with ZIR)
After: ~0.6ms to analyze build.zig (loading 2 modules without ZIR)

What changed:

  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.

  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.

Impact on real-world usage:

# Linting a single file that imports std
Before: ~2 seconds
After:  ~0.4 seconds (5x faster)

# Linting entire src/ directory
Before: Previously slow on large projects
After:  Dramatically faster startup and analysis

These optimizations can be easily reverted if control flow analysis is implemented in the future (see well-documented code comments in src/ModuleGraph.zig).

Technical Details

  • ZIR generation infrastructure remains in place and can be re-enabled by uncommenting documented code sections
  • Module graph now loads only user code + top-level std.zig instead of recursively parsing the entire standard library
  • All tests pass; linter functionality unchanged
  • Verified against GitHub history: ZIR added in commit 14bbe87 but never used by any rules

Installation

mise use github:rockorager/ziglint@v0.5.2

Or download pre-built binaries from the release assets.