You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The interpreter language is very slow. The main reason is that it has to evaluate the child constraints of the evaluators, which means checking the types for many nodes. Moreover, calculations on long collections are not optimized and take nearly linear time.
For many use cases, the basic concepts of KernelF that are needed (e.g. arithmetic/list operations etc) could be translated to Groovy and evaluated by the Groovy Script Engine that is shipped with the JBR or IntelliJ platform. Example:
KernelF (> 1000 ms): 10.upto(5000).map(|it: number{0} => it * 2|).where(|it >= 50|).size
Groovy (~7 ms):
The cost of translating the expression to Groovy is probably still less expensive than iteratively evaluating the collection with our interpreter. For simple expressions like "1+1" the overhead is too big, but for cases where the result is statically evaluable we could evaluate them directly in behavior methods the same way it is implemented in Base Language.
For more complicated expressions, we could maybe also jump out of the interpreter back to static evaluation if this brings any performance advantages.
The text was updated successfully, but these errors were encountered:
The interpreter language is very slow. The main reason is that it has to evaluate the child constraints of the evaluators, which means checking the types for many nodes. Moreover, calculations on long collections are not optimized and take nearly linear time.
For many use cases, the basic concepts of KernelF that are needed (e.g. arithmetic/list operations etc) could be translated to Groovy and evaluated by the Groovy Script Engine that is shipped with the JBR or IntelliJ platform. Example:
KernelF (> 1000 ms):
10.upto(5000).map(|it: number{0} => it * 2|).where(|it >= 50|).size
Groovy (~7 ms):
The cost of translating the expression to Groovy is probably still less expensive than iteratively evaluating the collection with our interpreter. For simple expressions like "1+1" the overhead is too big, but for cases where the result is statically evaluable we could evaluate them directly in behavior methods the same way it is implemented in Base Language.
For more complicated expressions, we could maybe also jump out of the interpreter back to static evaluation if this brings any performance advantages.
The text was updated successfully, but these errors were encountered: