openhab / openhab-js

openHAB JavaScript Library for JavaScript Scripting Automation
https://www.openhab.org/addons/automation/jsscripting/
Eclipse Public License 2.0
38 stars 31 forks source link

Optimal performance: with or without included openHAB JavaScript library #266

Closed dilyanpalauzov closed 1 year ago

dilyanpalauzov commented 1 year ago

One of the translation strings for openhab-js is:

Use the included openHAB JavaScript library for optimal performance.
Disable this option to allow loading the library from the local user configuration directory "automation/js/node_modules". Using a user provided version of the library may increase script loading times, especially on less powerful systems.

I think this contradicts itself. It says that the included openHAB JavaScript library guarantees optimal performance. But a user provided version (⇔the opposite of the included openHAB JavaScript library) may be better. For me “optimal performance” includes/implies “increased script loading times”, but the above paragraph suggests the opposite.

Please include in README.md some text about performance on included JavaScript library vs user provided JavaScript library.

florian-h05 commented 1 year ago

No, this doesn‘t contradict. increased script loading times means higher loading times/longer loading, which is worse performance. However, I‘ll talk to a few others to ask them about their opinion.

dilyanpalauzov commented 1 year ago

I agree with you. I do not know what was in my mind yesterday, as I interpreted “increased script loading time” as “faster loading”. May be I missed the word “time”.

stefan-hoehn commented 1 year ago

I second this: "Use the included openHAB JavaScript library for optimal performance." means it provides better performance as it directly uses the embedded version (=enabled option). When disabling the option it does load a user-provided version which needs to be loaded instead which decreases performance.