-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: V3: Oxc resolver #202
Conversation
FYI, I made Parcel's resolver a lot faster recently (basically rewrote the whole cache): parcel-bundler/parcel#9984 Benchmarked a bunch of resolver crates including OXC: https://github.com/parcel-bundler/parcel/blob/v2/crates/parcel-resolver/benches/benchmark.rs With caching:
Without caching (creating a fresh cache on each iteration):
Published it on crates.io as well in case you want to use it. https://docs.rs/parcel-resolver/ |
Edit: noticed we need to have the We haven't touched the oxc resolver for a while, so we can surely take a look to see where we can improve. |
I think it does make sense to maintain a resolver because we would rather have no resolver plugins. Instead, we'd add the few patches we are currently using on resolver plugins to the main rust code. @devongovett we can't use parcel resolver because it depends on That is, there is some unsoundness in the Regarding benchmark, while it is good to micro-benchmark, it's better to measure a real workload. We have an internal benchmark, which replays all imports in our application. On that benchmark, the current master branch of this repository performs as well as the Most importantly, the absolute times to resolve all imports in the repository are very low when they are executed concurrently (a few seconds to resolve all the imports with multi-threading). I think that if resolution is a build time bottle-neck today, it is only because the builds are based on crawling the module tree, and it'll be much more efficient to crawl the directory tree directly to parse and discover imports, then run resolution as a second time. Note that despite around 30% slower resolver (at the moment) in the master branch, and previously we had a 3x slower resolver than parcel master #156, the actual build times for this repository are 2x faster to build jira than what is in mainline parcel due to a few optimisations on packaging/optimisation phases. There is currently some degradation in perf. of the master branch resolver, when running new experimental code for building the asset graph in rust. This might be related to removal of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's talk about this internally.
FWIW, oxc_resolver also uses dashmap. Dashmap v6 was recently released as well. Maybe that fixed some issues you saw. |
I was hoping that was the case too, but I had looked at the diff between those dashmap versions and there did not seem to be significant changes that could fix the crashes. What we have now (thread local caches) performs really close to the concurrent dashmap but has much less surface area for unsoundness and is easier to understand. It'd be nice to review this at some point but we were having serious unreliability issues related to crashes (they were common, and certain engineers would experience crashes on every single run of certain builds). |
Will continue this discussion after I get back |
Maintaining our own Nodejs resolver is quite difficult, error prone and increases the maintenance/testing surface of Atlapack. This RFC is about replacing our native resolver with an oxc based resolver and supplies a reference for testing.
Using our benchmarks, oxc is 10% faster (though the actual plugin is doing less so YMMV), would like to test this against JFE to see if it resolves the tsconfig issues we are seeing
To use this just add
@atlaspack/resolver-oxc
to the.parcelrc
file