I’m not sure if Sublime has any particular line length limit, but thought I would do some tests here:
- Took my user prefs JSON file and concatenated it onto one line. Then grew it up to over 560k by repeating its content, ensuring it’s syntactically correct.
- ST2: Remains responsive, although minor slowdown in the UI. Syntax colouring remains active
- ST3: Remains responsive, although minor slowdown in the UI. Syntax colouring deactivates (somewhere around 16k length)
- Doubled the JSON line length to over 1.1M
- ST2: Remains usable though less responsive. Stalls when holding down Up/Down or PgUp/PgDown. Minimap and scrollbars usable. Text modification is laggy but usable. Syntax colouring remains active. Switching syntax to “Plain Text” makes no difference to performance. No crash or permanent freeze.
- ST3: Remains usable though less responsive. Stalls when holding down Up/Down or PgUp/PgDown. Minimap and scrollbars usable. Text modification is laggy but usable. Syntax colouring not active. Switching syntax to “Plain Text” makes no difference to performance. No crash or permanent freeze.
- For shits and giggles, I tried cranking the line length to 18M
- ST2: Very unresponsive UI, takes close to 2 seconds to respond to cursor movements. Same with PgUp/Down etc. Edits take 4-5 seconds. Colouring remains active.
- ST3: Very unresponsive UI, takes close to 2 seconds to respond to cursor movements. Same with PgUp/Down etc. Edits take 4-5 seconds. No syntax colouring.
So, in essence, I’m seeing the same behaviour for long lines in JSON in both ST2 and ST3 except that ST3’s colouring switches off at some length, around 16K I think. Interestingly, colouring being on in ST2 for huge lines doesn’t seem to degrade performance at all, at least for basic navigation and editing.
When line length exceeds 500K, Sublime’s UI starts to struggle increasingly. It remains comfortably usable at under 1M, and worsens exponentially after that. View…word wrap being on or off makes no difference to the above, nor does switching syntax to “plain text”.
Summary:
Though Sublime remained stable throughout these simple tests, it felt increasingly flaky with longer lines. It would be nice to see such performance issues addressed. Testing took place on a pretty powerful (3Ghz quadcore) machine (using x64 sublime); I’d expect things to be worse on a typical Core2/i5 type laptop.
Quite often as programmers we need to open big text files and perform manipulations upon them. They won’t always start out in a “nice” (linebroken) format to begin with; ironically we may want to load them up in Sublime to make them so. Such file and line sizes (up to a few Meg) are small and not uncommon these days.
I also noticed a lack of multiprocessing going on in these tests. All the CPU load was maxing out a single core. However Jon has engineered the editing core of Sublime, it could use some improvements.