-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal: speed up
FileInfoIdx
-from-path lookup (#859)
## Summary Cache the result of file-info-from-absolute-path lookups, avoiding unnecessary filesystem IO incurred by expanding file paths. This significantly increases the speed of the incremental compilation mode (which performs a lot of those lookups), with compile time reductions of up to 90% (measured with the `tstdlib_import_changed.nim` test). ## Details Add the `rawPathToIndexTbl` table to `MsgFormat`. It associates the unprocessed absolute file paths passed to `fileInfoIdx` with their resolved-to `FileInfoIdx`, preventing the repeated expansion of the same file paths. In addition, the line overrides in the `assert` and `jsAssert` templates are changed to use the no-argument form (`{.line.}`). The latter is semantically equivalent to the previous `{.line: loc.}`, while not performing an unnecessary `FileInfoIdx` -> filename -> `FileInfoIdx` round-trip. --------- Co-authored-by: zerbina <100542850+zerbina@users.noreply.github.com>
- Loading branch information
Showing
3 changed files
with
10 additions
and
2 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