- Replaced `Path.rglob("*")` with `os.walk()` for faster traversal.
- Implemented efficient directory skipping in `os.walk()`.
- Combined multiple secret scanning regexes into a single pattern with named groups for single-pass scanning.
- Switched to line-by-line file reading for secret scanning to reduce memory usage.
- Updated `docs/PERFORMANCE_OPTIMIZATIONS.md` and `.jules/bolt.md`.
Improved memory efficiency in `scripts/ci_validate_repo.py` by replacing
`read_bytes()` with chunked binary reading (64KB) for NUL byte detection.
This prevents loading entire source files into memory during CI runs.
- Consolidate file validation logic into a single loop
- Check file size before reading content to prevent loading large files into memory
- Add error handling for file reading
- Reduce I/O operations and loop iterations
This improves the efficiency of the CI validation script, especially for repositories with many files or when large files are accidentally introduced.