[ 
https://issues.apache.org/jira/browse/SLING-12635?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Radu Cotescu resolved SLING-12635.
----------------------------------
    Resolution: Fixed

> JS Use Scripts should only be read on-demand
> --------------------------------------------
>
>                 Key: SLING-12635
>                 URL: https://issues.apache.org/jira/browse/SLING-12635
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting
>            Reporter: Radu Cotescu
>            Assignee: Radu Cotescu
>            Priority: Major
>             Fix For: Scripting HTL JS Use Provider 1.2.12, Scripting HTL 
> Testing 1.0.38-1.4.0
>
>
> When SLING-9320 was implemented [0], the {{DependencyResolver}} was extended 
> to provide a {{ScriptNameAwareReader}}. This functionality was moved over 
> from the {{JsEnvironment}} but slightly rewritten to use a {{StringReader}} 
> instead of an {{InputStreamReader}}. This introduced a performance penalty, 
> since JS scripts are now completely read all the time, instead of being read 
> only when they need to be compiled/evaluated. The same change was applied to 
> the {{SlyBindingsValuesProvider}}, for the initialization of the factories 
> that support the JavaScript Use API.
> The code should be switched back to use an {{InputStreamReader}}, so that the 
> scripts are read on-demand when they must be compiled/evaluated.
> [0] - 
> https://github.com/apache/sling-org-apache-sling-scripting-sightly-js-provider/commit/6ebafff6d81367a3b7fb2ab942795f7a73972668#diff-cd9e9b522cd2455e47baa78c2bb6c701894b2064bf9882ecd81cd3af285396d9



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to