-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
CPU usage on file rename #286
Comments
Hi, @harveyr! That's right, linear sequential scanning isn't that fast. Rigrep could be used to speed it up. Another approach is to use indexing with workers or LSP, but it would require a good part of Memo re-architectured. So far, it served me well without indexing complexity in place, so probably using something like rigrep would be more preferable. I might take a look at some point but open to contributions as well. |
+1 I currently get "The extension 'Markdown Memo' took a very long time to complete its last operation and it has prevented other extensions from running." and some link updates are not performed. I really love Memo, but as I'm renaming a lot, changing my workflow to use a separate rename script is not really an option. It would perhaps be an option to "steal" from https://github.com/fabiospampinato/vscode-todo-plus, since they provide an option to use ag or rg to perform similar functionality. As I'm not the most advanced developer (to say the least) I would be super-happy to get this, since Markdown Memo is my weapon of choice no. 1 ;-) |
Hi 👋 , ripgrep (shipped with vscode binary) should be used in the latest version of Memo. Please update from Marketplace! The difference on 2k files test workspace (1 file with ref to rename, the rest are mock files with some content and other refs) is roughly the following:
The more files containing the ref the slower renaming process will be, but files not containing the ref should be now filtered away by rigrep and rigrep performance seems much better for that size of workspace. |
Awesome, thanks! Kudos... |
Hello!
The link-update process after a file rename is very CPU intensive. On my laptop, all 8 cores are ~100% consumed for 10 or 15 seconds. I have a little under 1700 files in my knowledge base, amounting to about 44,000 lines.
I won't pretend to know what the ideal solution is. As a workaround, I wrote a rename script that uses ripgrep to find all files that have references to the renamed file. This works more or less instantaneously. Here's the current state of that script, in case it's helpful: https://gist.github.com/harveyr/bac46beecd711ce374fa2829a0f4716b
Perhaps Memo could use more efficient search tools if they're available on the system? I'm actually pretty happy with my workaround, so I won't be offended if this isn't a priority.
Otherwise, I'm quite happy with Memo and I really appreciate your work on it! 👏
The text was updated successfully, but these errors were encountered: