Improve Parser Performance during file load

SyntaxEditor for Windows Forms Forum

Posted 5 years ago by Mike Dempsey - Sr. Developer, Teradata Corp
Version: 14.1.0320

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.



Comments (2)

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Mike,

Can you go into more detail on your syntax language setup.  Such as do you only have it doing syntax highlighting, or are you doing semantic parsing as well?  Either way, that sort of timing doesn't sound right for that size file.

It might be best if you write our support address instead and ZIP up your dynamic language XML file and a sample large file for us to try it.  Please reference this thread and rename the .zip file extension so it doesn't get spam blocked.  Then we can answer your questions better after looking at that.

Actipro Software Support

Posted 5 years ago by Mike Dempsey - Sr. Developer, Teradata Corp

OK I'll send the files.

The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.