Problems with using Javascript use api scripts
I have read from multiple blogs, HTL scripting documentation that JavaScript use scripts are compiled on run time and hence they are slower compared to Java use script and sling model. But I do not understand what does runtime here means, would the JavaScript code be compiled to Sling code when it is called by a component? or Would the code be compiled to Sling code once it is installed to the server? Also, if there is a performance overhead in using JavaScript use script over a Sling model, how big is it?
I have also read in so many questions that use scripts should be restricted to components. But I do not see any problems with use scripts processing data from multiple components as we could pass arguments while calling them. Is there any reason people prefer to restrict use scripts just to a specific component?