They should only be slow on the first run. After they ran the first time, they are cached.
However the initial run takes quite some time because in JS Scripting, the openhab-js library is loaded (which are many lines of code), in NashornJS no helper library is loaded. The openhab-js helper library allows easy access to the openHAB Java APIs without having to mess with Java types in a JS environment.
You can maybe speed up the initial run of a script by disabling the „Use Built-In Globals“ option (see JavaScript Scripting - Automation | openHAB) and then manually loading the parts of the helper library you need (using const { items } = require(‘openhab’);
as an example).
For openHAB 4, there are some major performance and memory improvements coming. So stay tuned!
On my Raspberry Pi 3 test system, I was able to reduce initial script execution time from 13 to just 2 seconds.