Sublime Forum

Extreamly slow while handling large data

#1

I would like to ask if anyone is facing this issue where it is extremely slow to open / view / edit / save large text files (json, sql, csv, with 1GB and above in size). I have tried opening a 2GB JSON file and it takes nearly 4 hours to completely open the entire file but once the file is finally open, it crashes.

FYI I am using Sublime Text 3 version 3103 but this problem has been here since Sublime Text 2

1 Like

#2

First all editors struggle with large files. Try editing a 2Go text file in notepad!

Edit: Most editors struggle with large file except if they have been carefully designed for them.

I often open big text files in Sublime (>1Go) and it handles them reasonably well.

But I usually donā€™t open big source files. When opening your ā€˜jsonā€™ Sublime will parse it, which can be long.
Also if you have line wrapping enable it will take you even longer.
And saving is long because Sublime has to write a 2Go file on your disk, and thatā€™s long.
If Sublime crashed my guess is that you run out of RAM. Loading a 2Go files would take at least 2Go of RAM in my experience.

Is there any way to automatically disable some options like Syntax and line wrapping on big files?

Also it would be nice to be able to open a big file but to only load a few parts of it. (Maybe there already is a plugin for that, I never looked up)

I also experienced that selecting all ā€˜fooā€™ and typing ā€˜barā€™ is much slower than doing a ā€˜search and replaceā€™ through the menu.

0 Likes

#3

I seeā€¦ when you meantioned about disks and RAM, will it be an affect since I am using:

Intel Core i7 6700K
64GB DDR4 RAM
2x Samsung 950 512GB NVMe SSD Raid 0

This setup is used solely for simulation purposes and data alteringā€¦

0 Likes

#4

Thatā€™s a pretty good setup! It seems unlikely that you runned out of RAM with 64Go, but you might want to monitor your RAM usage while youā€™re opening your Json file.

Is your Json valid?

And even if you have a SSD harddrive it would still be long to save a file. How much does it take to copy paste a big file versus modifying and saving it in Sublime?

0 Likes

#5

I always edit large text & csv files in my old v8 of Ultraedit. Sublime performance is much worse in my experience with GB size files

1 Like

#6

The only editor besides Vim Iā€™ve come across to open massive text docs with ease is BBEDIT

0 Likes

#7

A quick ā€˜hiā€™ as Iā€™ve been off the map for a little while. Returning to the topic at hand (and Iā€™ve commented on this a few times before over the years) Sublimeā€™s performance with either very large files (1Gb+) or files with very long lines (10k+ chars) leaves a lot to be desired. Generally I avoid using Sublime for such tasks and have to fall back to Crisp or Vim which handles pretty much anything with lightning performance.

@gwenzek respectfully disagree on the idea that editors always struggle with huge files. Those whose engines have been coded to handle them well do so with ease and there are numerous examples. Crisp, for example, demand-loads such files so editing an 8Gb file is no problem on a machine with 2G RAM.

Returning to Sublime, setting syntax to ā€œPlain textā€ often helps, since this effectively disables the heavy duty regexes required for scoping/colouring source, along with disabling wrap & highlight matches on S&R.

Sublime could do with some improvements in its editing engine, along with some adaptive intelligence with respect to handling large files and anything else which might be performance blocking. The reason? Iā€™ve maintained before that Sublime is a tough sell if it canā€™t be a ā€œswiss army knifeā€ editor for programmers and hackers. One of the jobs we all need to do from time to time is work with huge files (usually log files in my case) and itā€™s a shame that I canā€™t be in Sublimeā€™s environment (with its plentiful sugar) when doing so.

By ā€œadaptive intelligenceā€ I mean things like offering an abort when Sublime is doing anything that blocks the UI for a while - whether that be opening huge files or using plugins that end up doing more work than intended - changing editing engine setup when working with huge files, disabling wrap as mentioned above, disabling ā€˜highlight matchesā€™ for S&R, disabling colourisers etc. Since such parameters vary to some extent with hardware, itā€™d be nice to have thresholds configurable. Such improvements would make Sublime much more robust when working with large files, avoiding the ā€˜dohā€™ moments when you do an S&R on a big file and the whole UI locks up while it tries to highlight every match in the file.

Bottom line: Sublime isnā€™t great with big files. If youā€™re going to, turn off wrap, set plaintext and turn off highlight matches on S&R dialogs. Iā€™d love to see some work in this area and though I know itā€™s a chunk of work it would secure Sublime as the clear choice for programmers and hackers expecting high performance, powerful editing across all text file types and sizes.

:slightly_smiling:

4 Likes