Sublime Forum

Sublime runs very slow when loading large text file? (3103 & 3109, win 10)

#1

I have made a comparison between vim and sublime when loading large text file (27MB)

Time consuming:
MS text: 1s;
vim: 1s;
sublime 3: 12s. (all plugins have been disabled.)

why it is so slow? is there any way to speed up this process?

Any suggestions would be very appreciated.

0 Likes

#2

Is this text file loaded as plain text, or with a different syntax? Also, what version of Sublime Text are you using?

The answer below is a general answer about how Sublime Text works:

The way Sublime Text editor pane works is that is lexes source code files into tokens. Tokens are use for syntax highlighting, spell checking, word wrapping and more.

Depending on what syntax is being used, the lexing process can take some time. The actual syntax definition can be a big part of this. Syntaxes use regular expressions and state machine to determine when certain constructs are valid and what characters make up a given token.

In general we’ve been working on making this process faster with various of the default supported languages over time. Certain regular expression constructs are ignored to improve the lexing performance. Jon also wrote a custom regular expression engine for lexing that drastically improves performance for many syntaxes.

In addition to lexing, word wrapping has an effect on general performance since it affects the calculation of vertical offsets of a given line of text.

1 Like

#3

hi, thank you for reply.

Yeah, the file is a plain text file for recording some data. Every line of file have two numbers, but this file contains many lines (about 500,000 lines).

I have tested this on two different version (sublime 3103 & 3109, win 10), and the time consuming are about same to each other.

Are there anyone encountered this problem??

0 Likes

#4

If you send me the file I can try to open it and let you know how long it takes.

I’m using Linux though.

0 Likes

#5

hi. I have uploaded this test file into google drive, and you can test it.
https://drive.google.com/file/d/0B4_aPhHKh92FTkU2alN1ODFhdTQ/view?usp=sharing

After about 10s, the file can be loaded successfully, and there is also a msg ‘Detected ASCII vs Undefined with 100% confidence’ in the console. I don’t know whether it is because of this reason.

Beside, sublime will crush sometimes because of this large file…

thank you.

0 Likes

#6

Hey.

I’ve opened that file and it loads in 2 or 3 secs.

0 Likes

#7

ooh, that’s a big difference. Is there any lag when you do some operations for the whole file? such as, adding some words or numbers at the beginning of each line. :grin:

0 Likes