Replies: 1 comment 4 replies
-
Hi @Todo18, First, thank you for your kind words!
We tested a simple VBScript prime number sieve (2M capacity) in CScript and ClearScript, observing a penalty for the latter in the 1-5% range, depending on the run and the .NET runtime used, with greater variance for smaller capacities. As this benchmark is 100% VBScript code without any calls to the host, the only variable is the runtime environment, including ClearScript's managed implementation of the ActiveScript site interfaces. Unfortunately the overhead appears to be intrinsic to the .NET COM interop environment, so we have no way to mitigate it without modifying the runtime or using a native assembly for ActiveScript siting.
A difference that large is almost certainly due to the expensive boundary between managed and script code. What managed objects or types are you exposing? How often are you calling them from your script code? Are the affected scripts long-running? Please provide as much information as possible. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi,
First of all, thanks for providing (and maintaining) this really well-made, versatile scripting engine.
Our question is a general one about VBScript (and maybe JScript, since they're related) performance. We've noticed, since the integration with our software, that there's a significant difference in execution time between executing a script in ClearScript, and running that same script using the built-in interpreter of Windows (cscript.exe).
As we understand it, and judging from the source code, ClearScript talks to the same core libraries (ActiveScript) as the Windows Scripting Host (cscript/wscript), so there shouldn't be any (noticeable) difference in execution time between the two, especially for benchmark scripts that largely perform mathematical operations, for example? Any thoughts on why ClearScript takes on average about four times as long to execute such scripts? Maybe our integration is flawed? Although all we're doing is essentially instantiating a VBScriptEngine and calling Execute on this instance.
Kind regards
Beta Was this translation helpful? Give feedback.
All reactions