After upgrading to OH 4.0.1 i run into a time issue, so i tested a simple rule designed with blockly.
I did the test on a complete fresh install with just a view items and only one rule!
2023-08-09 20:37:49.034 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Hue_motion_sensor_3_Bewegung' changed from OFF to ON
2023-08-09 20:37:49.232 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'Tasmota_Vorhaus_Vorhaus_1' received command ON
2023-08-09 20:37:49.234 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Tasmota_Vorhaus_Vorhaus_1' predicted to become ON
2023-08-09 20:37:49.236 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Tasmota_Vorhaus_Vorhaus_1' changed from OFF to ON
from the time the motionsensor trigered to the change of the switch it is not even a quater of a second, as it was always before the upgrade.
Is it slow the first time the rule runs after itās loaded or every time?
From looking at the log this one at least is from the first load.
There was a problem with the caching of the library that was causing the rules to run slowly the first time they are triggered that I believe got fixed but not until after 4.0 release.
I checked, it is slow only on the first load, but iĀ“m on release 4.0.1 downloaded and installed last monday.
it also occures when i open the rule and just close it without saving.
My fix, which is working fine on my system and for @stefan.hoehn as well, is not backported to the 4.0.x branch, but there is no patch release that includes it yet.
You either have to wait for 4.0.2 or deploy the fixed bundle yourself, I will try to add a guide later.
Not all bug fixes get back ported to the existing release.
That might trigger a rule reload under some circumstances. You can watch the event stream in the developer sidebar or enable logging of rule events to events.log to verify.
Open a new thread so this situation can be analyzed in detail. This behavior has nothing to do with Blockly. Something is running amok on your machine consuming resources and forcing OH to have to wait.
@florian-h05 i just want to inform you that after the update to OH4.0.2-1, the delay is still there.
To make it sure i restarted OH twice and also uninstalled and installed the JS addon.
as i said already, i can live with that, because i ported all my rules already and i know that itās just on the first run.
Fully disagree. Try to develop a new rule.
My Wife told me that rules they must be fired before are slow after a while. That happens with 4.0.1. If 4.0.2 didnāt fix it then that will not be satisfied for me.
As discussed above, there are 2 problems. Slow execution which happens the first time a rule is run and what you are seeing. Thatās why I asked you to open a separate thread.
I can confirm, that now after 4.0.2-1 upgrade, rules run very slow.
Normal it takes to send a mail and a WhatApp a couple of secounds.
Now it takes 55 sec. (55 sec the rule itself shows the icon ārunningā)
Itās not important for me if I get the notification that rain started or something else
happend, like power off from a charger, but compared to 3.4.4 it seems a problem.
This only happens on my testsystem with this configuration:
Release = Raspbian GNU/Linux 11 (bullseye)
## Kernel = Linux 6.1.21-v7+
## Platform = Raspberry Pi 3 Model B Plus Rev 1.3
## Uptime = 17 day(s). 14:44:0
## CPU Usage = 2.01% avg over 4 cpu(s) (4 core(s) x 1 socket(s))
## CPU Load = 1m: 2.14, 5m: 2.36, 15m: 1.75
## Memory = Free: 0.00GB (1%), Used: 0.93GB (99%), Total: 0.94GB
## Swap = Free: 2.33GB (78%), Used: 0.66GB (22%), Total: 2.99GB
## Root = Free: 20.09GB (72%), Used: 7.67GB (28%), Total: 28.98GB
## Updates = 0 apt updates available.
## Sessions = 1 session(s)
## Processes = 125 running processes of 32768 maximum processes