sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
802 stars 38 forks source link

Undent Performance #990

Closed mbarkhau closed 6 months ago

mbarkhau commented 8 years ago

Could it be that the undent code is an O(n²) algorithm? I tried to undent 10000 lines of formatted json and sublime text froze. I waited a minute before killing it. In vim the same file is undented in under a second.

FichteFoll commented 8 years ago

Wouldnt't make sense to have it O(n²). Perhaps it was an issue with syntax highlighting the file?

mbarkhau commented 8 years ago

Yeah maybe. I'll test later today.

mbarkhau commented 8 years ago

So I set the syntax for the file to "Plain Text" and tried again. For an input of 12k lines it took 11 seconds to finish and for an input twice that size, it took 45 seconds.

BenjaminSchaaf commented 6 months ago

I can't reproduce this in build 4168, ST indents and deindents 100k lines in ~3 seconds and performance is ~linear.