-
Notifications
You must be signed in to change notification settings - Fork 637
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimise fast_path.resolve, remove
TreeFS._normalToAbsolutePath
Summary: Consolidate some path resolution logic in `metro-file-map`, and optimise `fast_path.resolve` for normalised relative paths beginning `..`. Benchmarks across >100k real paths at FB: ``` Loaded data for 342252 files ┌─────────┬───────────────────────────────┬─────────┬────────────────────┬──────────┬─────────┐ │ (index) │ Task Name │ ops/sec │ Average Time (ns) │ Margin │ Samples │ ├─────────┼───────────────────────────────┼─────────┼────────────────────┼──────────┼─────────┤ │ 0 │ '_normalToAbsolute' │ '2' │ 381483262.86121655 │ '±6.19%' │ 27 │ │ 1 │ 'path.resolve (native)' │ '1' │ 804749585.7477188 │ '±8.28%' │ 13 │ │ 2 │ 'fastPath.resolve (original)' │ '2' │ 388311313.0285189 │ '±8.00%' │ 26 │ │ 3 │ 'fastPath.resolve (improved)' │ '11' │ 87437206.5772181 │ '±5.45%' │ 115 │ └─────────┴───────────────────────────────┴─────────┴────────────────────┴──────────┴─────────┘ ``` Changelog: ``` - **[Performance]**: Improve resolution performance for files outside the project root. ``` Reviewed By: huntie Differential Revision: D45446644 fbshipit-source-id: 42c4c49c7560cd5a0d6446aba19ed7cc24f3a10b
- Loading branch information
1 parent
d376529
commit dc3cddf
Showing
3 changed files
with
59 additions
and
50 deletions.
There are no files selected for viewing
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