Answer the project-files FIXME with a measurement - #2143
Merged
Conversation
The comment guessed that prepending the root to every path would be very slow in large projects. It isn't: 4 ms for 50k files, 20 ms for 200k - next to nothing beside the listing it is prepending to, and 18 times faster than the expand-file-name it would otherwise take. Recording the numbers so the question stays answered.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The project.el integration's
project-filescarried a FIXME guessing thatprepending the root to every path "is probably going to be very slow in large
projects". Nobody had checked.
Measured:
20 ms on a 200k-file project, next to nothing beside the listing it is
prepending to - and
concatis already the fast choice here, 18 times quickerthan the
expand-file-namesomeone might reach for, since that consults thefilesystem's notion of the default directory for paths that are already absolute.
No code change; the comment now records the numbers so the question stays
answered rather than being re-asked by the next reader.