Re: [code] TA loading big C file

From: John Ferrier <john_j_ferrier.att.yahoo.com>
Date: Sat, 3 Nov 2012 16:42:10 -0700 (PDT)

I did a few tests with some other editors I often used, and the following are their behaviors:   1) quickly loaded the text in, then highlighted the syntax after a short while;   2) displayed a progress bar first, then displayed the text with syntax highlighted (e.g. sublime text 2);   3) gave a warning saying that the file was too large... and would load it as an text file... (e.g. komodo edit).   as for textadept, I did a very interesting test, where I first loaded  a relatively small C file with TA, then did the copy/paste many time to increase the number of lines, and finally saved the file. I found TA was able to do the syntax highlighting, but after I savec the file and relaunched TA, it failed as I described before. This may imply that there is room to improve the algorithm for syntax highlighting.   Another small bug I found during the tests is TA didn't display the line number >= 10000.     Regards,   JF   ----- Original Message ----- From: John Hind <john.hind.att.zen.co.uk> To: 'John Ferrier' <john_j_ferrier.att.yahoo.com>; code.att.foicica.com Cc: Sent: Saturday, November 3, 2012 7:03 AM Subject: RE: [code] TA loading big C file Yes, IMHO TA needs some improvements in the way it loads large files. I tried a 700K byte (6300 lines) HTML/Javascript file and it takes 1min 9 secs to load! In the JIT version it is faster, about 31 secs, but still not really acceptable given the UI is unresponsive. Programmers Notepad, another syntax highlighting Scintilla-based editor, loads the same file in less than 2 secs. I know there is a price to pay for the flexibility of Lua, but perhaps TA could detect large files and handle them differently? Even if it just loaded files over a set threshold as plain text. It could then have an 'analyse' command on the menu and present a proper progress bar during the operation. But ideally it should analyse the file on a separate thread and present plain text only if the user moves past the point in the file that the analysis has reached. If I remember right, Lua has a memory usage limit to trap recursion bugs, which is probably why it is failing in your case when you still have plenty of physical memory. -----Original Message----- From: John Ferrier [mailto:john_j_ferrier.att.yahoo.com] Sent: 03 November 2012 01:08 To: code.att.foicica.com Subject: [code] TA loading big C file Hi, I have a big C file (~58M and ~1.5M lines). When I tried to open it with TA ("ta aaa.c") I got: Lua Error: not enough memory. Lua Error: Table of tokens expected from lexer.lex. I have about 2G physical memory. However, if changed the file name and loaded it as a text file ("ta aaa") then there was no problem. Regards, JF -- You are subscribed to code.att.foicica.com. To change subscription settings, send an e-mail to code+help.att.foicica.com. To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com. -- You are subscribed to code.att.foicica.com. To change subscription settings, send an e-mail to code+help.att.foicica.com. To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Sat 03 Nov 2012 - 19:42:10 EDT

This archive was generated by hypermail 2.2.0 : Sun 04 Nov 2012 - 06:33:42 EST