Sublime Forum

Slowness when editing 1,000's of files at once

#1

I have an open source project with ~5,000 very simple text files:

There are a lot of tasks I would like to do in Sublime Text, such as simple finds and replaces. But often it just gets too slow (for example, “Save All”).

I then have to resort to sed/command line editing.

I have an M1 Mac with SSD.

I know this is probably an unusual use case, but it would be nice if I could easy breezy find/replace/save across thousands of files in my joyful Sublime GUI.

Maybe I’m doing something wrong. Dunno.

0 Likes

#2

Repro steps:

I just did a fresh install of Sublime Text, opened that git repo, and did a simple find/replace of 1 word across ~5,000 files. The actual replacement is fast.

But the “Save All” is painfully slow. I started it 3 minutes ago and it has only made it to the letter K so far.

It saves at a rate of 20 files a second or so. So to save 5K files takes over ~5 minutes.

And I’m beach balled that whole time.

0 Likes

#3

Further research: it only took 20 seconds to save 1500 edited files from (https://github.com/breck7/CancerDB/tree/main/concepts).

So 75 files saved per second.

Maybe there is some log linear or quadratic routine in the “Save All” command? (Of course, maybe its something external to sublime on my Mac/file system. I’m not sure)

0 Likes

#4

Further research: I’m able to save files in those folder at least over 1,000 files a second, outside of Sublime, so I suspect something in Sublime is causing this.

0 Likes

#5

By a fresh install do you mean you used a different or empty data directory so that there were for sure no third party plugins active? Generally the recommendation is to use ST’s safe mode.

1 Like

#6

I use perl’s command line one-liners for this.

1 Like

#7

For me, Save All slowness is noticeable even on a few changes to 3-4 HTML files. It takes 2-3 seconds for each trivial change to each file. So you are getting far better performance than I am.

In my case, I have created a keyboard shortcut for Save All. I use CTRL+ALT+A for the operation. I did the operation via mouse from the File > Save All menu item but it’s no quicker.

1 Like

#8

I haven’t used perl in ages but lately have been looking at it for various reasons and wow, so much beauty in that community.

Maybe I should make it one of my regular tools again.

0 Likes

#9

I backed up all my settings, then wiped Sublime from my computer and reinstalled it.

Still slow (when saving thousands of files, otherwise its great).

0 Likes