-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make optimisations to resolver implementation (#9903)
* Make optimisations to resolver implementation The main change in this diff is removing an extra `is_dir` / `is_file` call which I had added. We ran benchmarks replaying all imports of a large application against multiple resolver implementations. In practice, the previous code had around 10% worse performance than the shared structures code. The difference in performance goes away by removing those extra `is_dir` and `is_file` calls. There is no difference achieved from preventing copies. I'll attach performance profiles captured on macOS. After the fixes in this commit, the new resolver crate out-performs the older one by 26-27%. That is due to a change on top of the FS calls revert, which I've found through profiling. Hashes have been replaced for both implementations' filesystem canonicalize cache, which is the hottest by a faster hashing function. The worse culprit of CPU time at the moment is hashing file-paths on this benchmark. This might be due to how the file-paths are passed into the benchmark, but we're constantly re-hashing file-path components to store in these cache hash-maps. The total time of resolving all the application level imports on multiple threads (~500k) on this application is: * 2.13 seconds for M1 Pro (new branch) * 2.88 seconds for M1 Pro (old branch) This is consistent across runs and based on an average of 50 executions over this entire list. On a large Linux EC2 instance the results are similar, but resolution is even faster. After path hashing, the next hottest path are the file-system calls. DashMap does not appear to have a huge impact on performance on its own, and is showing-up on crash reports. I'm adding it back hoping it's not the culprit. * Use xxhash instead of gxhash This did not change the results of the previous commit 5682caa significantly. * Fix compilation failures * Fix compiling tests * Fix unit-test compilation
- Loading branch information
Showing
11 changed files
with
96 additions
and
138 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.