Skip to content

Conversation

reactormonk
Copy link
Contributor

No description provided.

Araq added a commit that referenced this pull request Feb 2, 2014
@Araq Araq merged commit cc3c10c into nim-lang:devel Feb 2, 2014
Araq added a commit that referenced this pull request Apr 7, 2014
Clyybber pushed a commit to Clyybber/Nim that referenced this pull request Sep 16, 2023
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants