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
{{ message }}
This repository has been archived by the owner on May 7, 2020. It is now read-only.
There's a performance problem with the DSL parser.
After comparing lots of code samples, we believe it shows when we use code that is working with/casting primitives (Java value types) instead of Number types, i.e. item.state.intValue or variable as integer or the like.
This happens to quite numerous people on the forum. I managed to reproduce it on a RPi3 running latest Zulu Java 8. I don't know if it can be reproduced on other processor/Java combinations.
And since I still have rules files that - after eliminating that code in question - still take long to compile I'm inclined to believe that this is not the only problem instance.
But at least it's reproducible so please try tackling that (by using a Java profiler ?).
I believe it'll be easy to reproduce with code of your choice. I used the code below.
The parser took 2.2 seconds on a RPI3:
2018-12-21 16:12:08.077 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Y.rules'
2018-12-21 16:12:10.289 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'Y.rules'
After I copied those last 3 lines 20 times (i.e. 60 occurences of integer casting), parser processing time jumped to 8.8 seconds.
2018-12-21 16:13:05.232 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'X.rules'
2018-12-21 16:13:14.075 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'X.rules'
I don't think that is normal and intended behavior but a parser bug. Under normal conditions, compiling common large rules files of 1k lines in size also just takes less than 10 seconds.
var Timer waitTimer
var HSBType HSBvalue
var String redValue
var String greenValue
var String blueValue
rule "Licht manuell setzen"
when
Item Testschalter received command
then
hsbValue = EG_Wohnen_Decke.state as HSBType
redValue = (hsbValue.red as integer).toString
greenValue = (hsbValue.green as integer).toString
blueValue = (hsbValue.blue as integer).toString
end
There's a performance problem with the DSL parser.
After comparing lots of code samples, we believe it shows when we use code that is working with/casting primitives (Java value types) instead of Number types, i.e.
item.state.intValue
orvariable as integer
or the like.This happens to quite numerous people on the forum. I managed to reproduce it on a RPi3 running latest Zulu Java 8. I don't know if it can be reproduced on other processor/Java combinations.
And since I still have rules files that - after eliminating that code in question - still take long to compile I'm inclined to believe that this is not the only problem instance.
But at least it's reproducible so please try tackling that (by using a Java profiler ?).
I believe it'll be easy to reproduce with code of your choice. I used the code below.
The parser took 2.2 seconds on a RPI3:
2018-12-21 16:12:08.077 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Y.rules'
2018-12-21 16:12:10.289 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'Y.rules'
After I copied those last 3 lines 20 times (i.e. 60 occurences of integer casting), parser processing time jumped to 8.8 seconds.
2018-12-21 16:13:05.232 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'X.rules'
2018-12-21 16:13:14.075 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'X.rules'
I don't think that is normal and intended behavior but a parser bug. Under normal conditions, compiling common large rules files of 1k lines in size also just takes less than 10 seconds.
PS: just for reference, originally I opened this as openhab/openhab-core#451
The text was updated successfully, but these errors were encountered: