Repository navigation
Replace Chevrotain parser with 42x faster single-pass parser - #37
Merged
Merged
Conversation
This replaces the Chevrotain-based parser with a hand-optimized single-pass parser that is 11.7x faster than the legacy xcode package and 42x faster than the previous Chevrotain implementation. Performance improvements: - Throughput: 7.5 MB/s → 315 MB/s (42x improvement) - react-native fixture (29KB): 2.47ms → 120µs (20x faster) - swift-protobuf fixture (263KB): 33ms → 800µs (41x faster) Key optimizations: - Single-pass parsing without CST intermediate representation - Pre-computed lookup tables (Uint8Array) for character classification - Char code comparisons instead of string operations - Fast path for strings without escape sequences - Direct object construction without visitor pattern overhead Additional improvements: - Better error messages with line and column numbers - Handles all edge cases that crash the legacy xcode package - Added benchmark suite (bun run bench) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add performance comparison table showing 11x speedup vs legacy xcode - Document benchmark command (bun run bench) - Update solution section to reflect new parser architecture - Check off benchmarks in TODO list Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
EvanBacon
force-pushed
the
@evanbacon/fast-parser
branch
from
February 27, 2026 20:22
7721188 to
4cf05f9
Compare
gronxb
pushed a commit
to gronxb/hot-updater
that referenced
this pull request
Aug 6, 2026
…p version (#1124) * fix: prefer Info.plist over project.pbxproj for the iOS app version Parsing project.pbxproj is synchronous, so on a large project it blocks the event loop for the whole parse. deploy does this after the bundle has already been uploaded, just to fill in metadata.app_version. CFBundleShortVersionString is also closer to what the built app reports than MARKETING_VERSION (#84). xcodeproj stays as the fallback. * fix: bump bundled @bacons/xcode to 1.0.0-alpha.33 alpha.24 is from December 2024 and predates EvanBacon/xcode#37, which replaced the Chevrotain parser with a single-pass one. On a 12.5MB project.pbxproj, XcodeProject.open() drops from 286s to 0.2s for identical output. The only API used here is XcodeProject.open().toJSON() in getIOSVersion.
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.
Summary
xcodenpm packagebun run bench)Performance
vs Legacy
xcodePackageKey Optimizations
Uint8Array)Additional Improvements
Test plan
🤖 Generated with Claude Code