Hi,
A while ago, I did a pretty big search and replace. I ended up changing 8000 files and ran into an edge case that you might not have thought about.
Sublime Text open every single file to do the replace. The process because of this was painfully slow and even though I had 40GB free RAM to use, Sublime Text only utilized about 2 GB of that memory. Due to the single process nature of things obviously I had to force quit the application.
To make matters worse, it remembered which projects had been opened, and to make matters even worse still it remembered which files each project had open. To make matters even ridiculously difficult it also tried to reload each of the changed files from my hard drive popping up 8000+ popups asking me to reload each file (because I had to resort to solving the problem in VS Code who handles such a regex replacement in a project in a few seconds.
Obviously, I am not super pleased with this situation. I’d prefer to not have to resort to VS Code for such a task because quite frankly, I love Sublime Text.
- For the replacement results, is it possible to just change the files without opening them? Can I configure that somehow?
- Can I just reload files from disk automatically? Which setting is that?
- Would it be possible for Sublime Text to use more of my RAM? I do have 64GB, docker uses 24GB and I’d like for Sublime Text to be able to use more of my available memory, at least in spikes when for example searching and replacing in a large number of files in a project.
- How do people handle such large search and replace? Seems like such a shame to use grep or another editor here. I’m sure others have done such refactorings (hopefully with better results than me).
- Should I turn off “remember open files and projects”? Seems a shame but if that fixes the problem with the startup then it might be worth it.
Looking forward to some answers and general guidance! Keep up the great work you are putting in towards the next Sublime Text release. v4 is fantastic so far!