Posted 20 years ago by Jake Pearson - Software Developer, Alion Science and Technology
Avatar
Hi,
I am using the Syntax Editor ( really like it). My program has a large number of small snippets of C# in it. I have a search window that hunts through my document tree (reflexively) looking for string properties. When I hit one, I have been passing the string to a hidden instance of the SyntaxEditor then using its MarkAll function to get all of the places where the find string occurs. The problem is that assigning to SyntaxEditor.Document.Text is relatively slow (according to my code profiler).

I have called SuspendLayout() and SuspendPainting() on the control. Are there any other things I can turn off to improve the performance. I do not need any rendering, or parsing. Mainly I just want to use the SyntaxEditor to get line/column numbers.

thanks,
Jake Pearson

Comments (8)

Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
The lexical parsing is probably what is taking the time. Painting and layout doesn't cost much performance-wise. Make sure you use a very simple language, you might even want to construct one that just loads any character into a single token. Plain Text language (which is included by default) breaks up words and whitespace, which will take a little longer than a simple language that has a token that accepts any character.

From this and another post it almost sounds like we need to look into a way where you can turn off lexical parsing for situations like this. I'll add an investigation into that into the TODO list.


Actipro Software Support

Posted 20 years ago by Jake Pearson - Software Developer, Alion Science and Technology
Avatar
Hi,
Thanks for the reply. I never assigned a language file to my instance of the SyntaxEditor. Is one assigned by default?

thanks,
Jake
Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes... there is one at SyntaxLanguageDomain.PlainText that gets assigned by default.


Actipro Software Support

Posted 20 years ago by Jake Pearson - Software Developer, Alion Science and Technology
Avatar
Hi,
I am getting an OutOfMemory exception when I assign to the Text property of an instance of the SyntaxEditor. I have the following stack trace:

system.drawing.dll!System.Drawing.Graphics.FromHwndInternal(int hwnd = 852464) + 0x56 bytes
system.windows.forms.dll!System.Windows.Forms.Control.CreateGraphicsInternal() + 0x1a bytes
system.windows.forms.dll!System.Windows.Forms.Control.CreateGraphics() + 0x2b bytes
actiprosoftware.syntaxeditor.dll!ᐱ.ᐁ(int = 0, int = 0, int = 0, bool = true) + 0xc3 bytes
actiprosoftware.syntaxeditor.dll!ᐱ.ᐁ(System.Object = {ActiproSoftware.SyntaxEditor.Document}, ActiproSoftware.SyntaxEditor.DocumentModificationEventArgs = {ActiproSoftware.SyntaxEditor.DocumentModificationEventArgs}) + 0x276 bytes
actiprosoftware.syntaxeditor.dll!ActiproSoftware.SyntaxEditor.Document.OnTextChanged(ActiproSoftware.SyntaxEditor.DocumentModificationEventArgs e = {ActiproSoftware.SyntaxEditor.DocumentModificationEventArgs}) + 0x5e bytes
actiprosoftware.syntaxeditor.dll!ActiproSoftware.SyntaxEditor.Document.ᐁ(ActiproSoftware.SyntaxEditor.DocumentModification = {ActiproSoftware.SyntaxEditor.DocumentModification}) + 0x5fc bytes
actiprosoftware.syntaxeditor.dll!ActiproSoftware.SyntaxEditor.Document.set_Text(string value = "Root") + 0x6c bytes
actiprosoftware.syntaxeditor.dll!ActiproSoftware.SyntaxEditor.SyntaxEditor.set_Text(string value = "Root") + 0x1c bytes
> maad.network.dll!MAAD.Network.Utilities.TextSearcher.SearchText() Line 36 C#

Any idea?

thanks,
Jake
Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I have seen this happen in some very large applications on computers that don't have a lot of memory, even on windows that didn't have SyntaxEditor on them. It's a very strange exception and I'm not sure how to cause it to happen. Obviously it has something to do with memory.

SyntaxEditor 1.0 uses a decent amount of memory to store the compiled DFA regex data. SyntaxEditor 2.0 uses a lot less memory since there are no DFA tables to store in memory. Have you had a chance to try out 2.0 beta and see if that helps with this problem?


Actipro Software Support

Posted 20 years ago by Jake Pearson - Software Developer, Alion Science and Technology
Avatar
Could you add me to the beta, or send a link to download it?
Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ok, just go to the beta forum now and the download info is in there. Please give an update and I'd love to hear your feedback on 2.0 as well. Keep in mind that 2.0 has numerous interface changes over 1.0 although you might not run into to many of them depending on how much advanced functionality of SyntaxEditor you use.


Actipro Software Support

Posted 12 years ago by jorgea - Burbank CA
Avatar
I hope this technical problem was completely resolved by now. If you did let me know what you did exactly. Thanks.
The latest build of this product (v24.1.0) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.