Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have option to disable host variables #5

Closed
PeteDuncanson opened this issue Feb 18, 2015 · 2 comments
Closed

Have option to disable host variables #5

PeteDuncanson opened this issue Feb 18, 2015 · 2 comments

Comments

@PeteDuncanson
Copy link

Found that if you use the V8Runtime.CreateScriptEngine method for spinning up a new engine context you can pass in options to disable allowing calls out to the .net host environment or variables. This should give a "significant" performance boost apparently. Might help with #3

See Microsoft.ClearScript.V8.V8ScriptEngineFlags Enumeration

Option DisableGlobalMembers - Specifies that support for GlobalMembers behavior is to be disabled. This option yields a significant performance benefit for global item access.

For reference GlobalMembers - Defines options for exposing host resources to script code.

@Daniel15
Copy link
Owner

Looks like JavaScriptEngineSwitcher added support for DisableGlobalMembers in version 1.2.3: https://github.com/Taritsyn/JavaScriptEngineSwitcher/blob/master/CHANGELOG.md

You may even be able to just set this in your Web.config or App.config file, if JavaScriptEngineSwitcher has implemented that.

@Daniel15
Copy link
Owner

Upgraded JavaScriptEngineSwitcher to the latest version in fd946d9. This update allows you to set this flag in your Web.config or App.config:

<configuration>
    ...
    <jsEngineSwitcher xmlns="http://tempuri.org/JavaScriptEngineSwitcher.Configuration.xsd">
        ...
        <v8 disableGlobalMembers="true" />
    </jsEngineSwitcher>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants