Batch directory listings in project detection#2010
Open
bbatsov wants to merge 2 commits into
Open
Conversation
projectile-root-bottom-up probed each directory level with one file-exists-p per marker (9 stats per level with the default VCS list). On a cache-miss walk up a deep tree over TRAMP that's depth*9 sequential round-trips. Probe each level with a single directory-files listing instead, the same trick projectile--vcs-from-directory-listing already uses. Markers carrying a path separator can't be answered from a basename listing and fall back to file-exists-p. Factor the listing into a shared projectile--directory-entry-set helper and reuse it in the VCS probe.
projectile-detect-project-type walked all 50+ registered types, each running file-exists-p per marker file. On a remote project that's dozens of sequential round-trips on the first detection. List the project root once and answer plain-name markers from that listing; markers carrying a path separator (debian/control, the bloop settings file) fall back to file-exists-p. Threaded through an optional entry-set argument on projectile-verify-file/projectile-verify-files so existing callers are unaffected.
8e928c6 to
e9eff94
Compare
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.
Follow-up to #2009 with the TRAMP perf work from that review. Two cache-miss hot paths in project detection were doing one
file-exists-pper candidate; both now issue a singledirectory-fileslisting per directory, the same trickprojectile--vcs-from-directory-listingalready uses.projectile-root-bottom-up:depth * markersround-trips up a deep tree becomedepth.projectile-detect-project-type: dozens of stats across all registered types on first detection of a remote project become one.Markers with a path separator fall back to
file-exists-p, so nothing changes fordebian/controland friends.