4 ms·
This is a great post showing effective performance analysis. It's worth noting that Emacs's built-in way to find files (project-find-file) in a project does no
by brokenwallet 6y ago
This is a great post showing effective performance analysis.
It's worth noting that Emacs's built-in way to find files (project-find-file) in a project does not suffer these performance issues. Try it, C-x p f.
* project-find-file doesn't call expand-file-name for all 70k files (each of which involves a network roundtrip).
* project-find-file will use "git ls-files" (see project--vc-list-files) rather than find (or expecting the user to install and enable fd)
* project-find-file uses completing-read, which wouldn't by default call Ivy/Ivy prescient.
I can see how the author has ended up here: projectile predates the built-in project support, so it must only seem natural to use projectile as a base, and apply performance fixes on top.
Emacs's built in functionality tends to work better with other Emacs functionality, hence why project-find-file works well with TRAMP.
It's worth trimming your config occasionally, and rebasing onto built-in functionality.
The author's fast-project-find-file has a more responsive UI, however. It'd be great to have that in core.
- omaranto 6y ago> * project-find-file uses completing-read, which wouldn't by default call Ivy/Ivy prescient. Not by default, that's true, but for users that have installed ivy and activated ivy-mode, ivy does take over completing-read.
- omaranto 6y ago> It's worth noting that Emacs's built-in way to find files (project-find-file) in a project does not suffer these performance issues. Try it, C-x p f. That is your personal key binding, project-find-file does not seem to have a default key binding. (This, by I which I mean telling people that some built-in command is bound to some key while forgetting that is in my configuration and not by default, has happened to me several times.)
- catern 6y agoActually it's a default key binding in the (yet unreleased) Emacs 28. project.el has a lot of nice improvements in the upcoming version of Emacs. (I imagine the grandparent comment author just checked the version tag in `C-h k C-x p f' to see when it was released, but currently on Emacs HEAD the keybinding doesn't have a proper version tag - that's a big, albeit minor)
- brokenwallet 6y ago'C-x p f' is a binding for project-find-file in project 0.5.3: https://elpa.gnu.org/packages/project.html https://elpa.gnu.org/packages/project.html Emacs 27 users can upgrade to this, or wait until Emacs 28.
- omaranto 6y agoI see, thanks!
- omaranto 6y ago> Emacs's built in functionality tends to work better with other Emacs functionality, hence why project-find-file works well with TRAMP. I think it's more than that, there is a higher barrier to entry for code in Emacs than in third party packages. Given that it's not surprising if built-in code is higher quality than external packages on average.
- brokenwallet 6y agoUpdate: I only just saw Part 2 of the post, which is fantastic too. I like how it describes different tools by the different values they prioritise. I agree with the post's thoughts in the tradeoffs involved in Emacs's development.
- mpereira 6y agoI'm glad you enjoyed it :)