OH3: to use or not to use JS (ECMAscript 2021)

Yes, correct. It was just 2 lines of code. I‘ll do another test once I migrated my production system to Pi5 or if you want, you can provide me with a test rule which includes some CPU-intensive code.
Would GraalVM be the faster JRE according to your knowledge?

It’s not so easy to create such a test case. Basically you only need a much larger amount of code to get a better comparison.
I guess the openhab-js codebase is already bigger than 99% of the user scripts.

And having some CPU-intensive operation code does not affect compilation time, but only execution time.

It should be faster because only with GraalVM the optimised Graal JIT Compiler is available (you can make it available on stock JRE, but we haven’t implemented that and TBH I don’t know if this is possible for openHAB and how to do it). However with smaller code bases to compile, I guess there is no measurable difference.