Posted 12 years ago by ori
Version: 4.0.0256
Avatar
Hello,

I'm using the Document.LoadLanguageFromXml method to load a syntax from a file.
If I have multiple editors - should I use a cache for languages to avoid IO and xml parsing?

Thanks.

Comments (3)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes definitely. The "Language Definition Guide / Optimization" topic talks about reusing language instances among multiple Documents as good design.


Actipro Software Support

Posted 12 years ago by ori
Avatar
Hi,

Some times I want to get a language and I prefer to load it from the cache and not from the xml file, and change it. It is problematic because it means I'm changing the cache and I don't want to do it. Is there a way to copy a language (copy constructur) to another language object - or should I stay with xml and IO operations?

Thanks,
Ori
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Sorry there currently is not a cloning mechanism built into languages. So if you have multiple instances of a language that will be different, perhaps you should not cache them.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.