Sublime Forum

Regex performance

#1

First off big fan of Sublime and use it every day.

The only pet peeve for me is find and replace performance using regex. I find if I have a file with upwards of 50000 characters and I do a simple newline replace or text substitution on the file, Sublime hangs and does not respond, eventually completes the operation or crashes completely. I’ve tried the same operations in ultraedit et al and it works in the milliseconds with no problems.

Is this a known issue, or am I doing something silly?

0 Likes

#2

Performance isn’t ideal: syntax highlighting data is recalculated after each modification to the buffer, so large find and replaces can be slow. In some cases it can be a big speed gain to switch to using “Plain Text” for the syntax, doing the replacement, then switching back. I realise this isn’t great, and there are some things that’ll fix it on the todo list, but they aren’t scheduled to be done soon.

0 Likes

#3

Thanks for the information, I’ll try the plain text option to see if it improves matters.

0 Likes

#4

any update on this?

maybe just deactivate syntax highlight automatically/temporary while performing the search/replace operation?

0 Likes

#5

Performance should be much better in the current betas, since 20091113 the interaction between regex replacement and syntax highlighting has been removed.

0 Likes

#6

for me it is still much faster if i switch to plaintext before the search/replace operation. i only really notice it with big files though…

0 Likes