Randomly delayed execution rules

Hello.
My rules in Openhab are performed at different rates - delay as 1 second and the second time operation after 4-5 seconds. In practical terms, the lighting of the lights when motion is detected by the PIR. I checked and the condition of the motion sensor in the GPIO Raspberry Pi2 is changing rapidly.
Where is the problem?

Did you changed a .rule file in between two measurements? Rules need to be complied first after you change something. openHAB is doing this for you, the first time something is calling a rule. The compiling will need some time and the execution is delayed a lot on my RaspberryPI.