Validator context based [message #1849275] |
Tue, 11 January 2022 02:01  |
Eclipse User |
|
|
|
Hello and a Happy New Year,
I have a curiosity regarding a way in which the validator of a grammar can be improved from a performance point of view.
I was wondering if it's possible to apply only those checks that are relevant for the context in which the editing is done.
For example, if I have two types of entities, to determine in which type of entity the change was made and apply only those relevant checks instead of having all of the checks of the grammar running. I'm not sure if this makes sense or even if it's worth it to do something like this.
A little bit of context, one of the files ended up with 55k lines and we have around 60 checks, so every little change has quite an impact.
I've already set the type of some of the checks to expensive, but I was looking into other ways in which the performance can be improved on this side.
Thank you,
Alexandra
[Updated on: Tue, 11 January 2022 02:01] by Moderator
|
|
|
|
|
|
|
|
|
Re: Validator context based [message #1849344 is a reply to message #1849343] |
Thu, 13 January 2022 05:02  |
Eclipse User |
|
|
|
Yes, this is what Christian meant. It might be more efficient to implement validation on the containers. You might be able to evaluate some context for the check that you need for each instance.
But especially within your validation rules watch out where you do loops. Try to reduce to a minimum.
Note that IterableExtensions#size() is expensive, depending on the Iterable's size. Sometimes you might only want to check if some iterable is empty or not.
|
|
|
Powered by
FUDForum. Page generated in 0.04969 seconds