Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[automation] Cache parsed script in order to improve performance #2057

Merged
merged 1 commit into from
Jan 3, 2021

Conversation

kaikreuzer
Copy link
Member

Since we have a dedicated DSLScriptEngine instance per rule script action, we can easily cache the parsed script.
Parsing seems to cause significant CPU and memory usage - with this PR, there is no noticeable CPU activity anymore and also the heap size does not increase over time anymore.

Fixes #1877
Fixes #2031

Signed-off-by: Kai Kreuzer kai@openhab.org

Signed-off-by: Kai Kreuzer <kai@openhab.org>
@kaikreuzer kaikreuzer added enhancement An enhancement or new feature of the Core automation labels Jan 2, 2021
@kaikreuzer kaikreuzer requested a review from a team January 2, 2021 23:24
@kaikreuzer kaikreuzer added rebuild Triggers the Jenkins PR build and removed rebuild Triggers the Jenkins PR build labels Jan 3, 2021
Copy link
Member

@wborn wborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looks like a very nice performance improvement!

@wborn wborn merged commit 531a478 into openhab:master Jan 3, 2021
@wborn wborn added this to the 3.1 milestone Jan 3, 2021
@kaikreuzer kaikreuzer deleted the cachescript branch January 11, 2021 19:23
@DanielMalmgren
Copy link

I can't seem to find this PR in the list of fixes for 3.0.1. Does that mean we will have to either switch to snapshots or wait for the next milestone to get it? It's kinda critical for my system.

kaikreuzer added a commit that referenced this pull request Jan 27, 2021
Signed-off-by: Kai Kreuzer <kai@openhab.org>
@kaikreuzer kaikreuzer added the patch A PR that has been cherry-picked to a patch release branch label Jan 27, 2021
@kaikreuzer
Copy link
Member Author

@DanielMalmgren Added. 3.0.1 is not yet announced, unfortunately, there were some issues during the build.

@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/openhab-3-runs-out-of-memory-java-heap-space-errors-cpu-100-after-a-few-hours/110924/68

@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/openhab-3-runs-out-of-memory-java-heap-space-errors-cpu-100-after-a-few-hours/110924/105

@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/openhab-3-runs-out-of-memory-java-heap-space-errors-cpu-100-after-a-few-hours/110924/127

@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/openhab-3-runs-out-of-memory-java-heap-space-errors-cpu-100-after-a-few-hours/110924/152

splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 11, 2023
Signed-off-by: Kai Kreuzer <kai@openhab.org>
GitOrigin-RevId: 531a478
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation enhancement An enhancement or new feature of the Core patch A PR that has been cherry-picked to a patch release branch
Projects
None yet
4 participants