You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Chetan Mehrotra (JIRA)" <ji...@apache.org> on 2015/11/10 06:29:11 UTC

[jira] [Commented] (SLING-3635) [Javascript] Optimization level for byte code generator in Rhino should be configurable

    [ https://issues.apache.org/jira/browse/SLING-3635?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14997978#comment-14997978 ] 

Chetan Mehrotra commented on SLING-3635:
----------------------------------------

bq. This option should be configurable, and the default value for this configuration should be "-1" - meaning run scripts in interpreted mode. Since we are not caching script compilation artifacts, the interpreted mode gives the best performance for short-running scripts.

Given that with SLING-913 compiled scripts are cached should the default be changed?

> [Javascript] Optimization level for byte code generator in Rhino should be configurable
> ---------------------------------------------------------------------------------------
>
>                 Key: SLING-3635
>                 URL: https://issues.apache.org/jira/browse/SLING-3635
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>    Affects Versions: Scripting JavaScript 2.0.12
>            Reporter: Marius-Andrei Danila
>            Assignee: Bertrand Delacretaz
>             Fix For: Scripting JavaScript 2.0.14
>
>         Attachments: SLING-3635.diff
>
>
> The Rhino Javascript engine allows you to choose the level of optimization for the generated byte code or it lets you select whether the scripts should be run in interpreted mode [0].
> Currently, there is no way to configure this. By default, Rhino compiles scripts into JVM classes using the optimization level 0.
> This option should be configurable, and the default value for this configuration should be "-1" - meaning run scripts in interpreted mode. Since we are not caching script compilation artifacts, the interpreted mode gives the best performance for short-running scripts.
> The attached patch implements this improvement by exposing a configuration entry in the Rhino Javascript engine factory component.
> [0] https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Optimization



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)