Is there anything I can do to improve parser performance - specifically while loading, or working with, very large files?
For small files (<100KB) the parser performance is acceptable, but as customers start to load large files it becomes increasingly [exponentially] slower.
For example a 2.2MB file took over 90sec to load on my very high performance new system.
(It took about 5 mins on the customers older system)
The previous version of my product (which used the Winmain CodeMax editor) took less than 3 seconds to load/parse the same file.
Both products use a dynanic language file [loaded from an XML file - very different model, but essentially the same definitions], apply the same highlighting options and uppercase the same keywords. The only difference [in terms of the parsing] is that in the new version I also perform outlining.
[However switching off the outlining did not improve it by very much]
Another difference I noticed was that the user gets instant feedback in the old app - the text is immediately loaded into the control and then the syntax highlighting is applied over the next couple of seconds. With syntax editor however the app basically locks up and does not repaint until after it has completed the entire process.
I tried switching off the parser and manually loading the text, then switching the parser back on again. Although that did, very quickly, give the user something to look at it still locked up for just as long, and failed to Uppercase the keywords that should have been Autocased. (I don't understand that part at all.)
What is maybe even worse is that once I finally get the text loaded/parsed it is VERY slow to work with.
Simply typing a letter takes over 1/2 sec for the letter to appear.
I assume you re-parse the area around the cursor as soon as the letter is typed - but even for a slow typist like me it is impossibly slow to work with.
Can the parsing be done in a separate thread so that the typing appears as normal?
(I think Codemax used a separate thread so that the UI was always responsive)
Also, is there any way to switch off the syntax highlighting without switching off the parser itself?
That presumably accounts for some of the time so I could use it as a way to improve performance.
(I need the text to be parsed for when the user submits the SQL script, but they could live with it being entirely black and white. The way I deal with a user's request for 'no highlighting' currently is to set all Highlighting styles the same. The old product allowed the highlighting to be enabled or disabled so long as parsing was enabled.)
Note that I need to use a Dynamic language because the app suports about 17 different SQL dialects so I need to be able to load the appropriate definitions on demand.