Closed lahma closed 5 years ago
Hello, Marko!
I added support of the Jint version 3.0.0 Beta 1598 in the JavaScriptEngineSwitcher.Jint module (9c144b2).
At the moment, unit tests defined in the PrecompilationTestsBase
class are failing (error is unstable and is associated with multithreading). I may have to store the instance of the Esprima.Ast.Program
class in serialized form.
Great news, thank you for following up so quickly! Engine indeed is not thread-safe and should not be shared between threads. If you have time at some point to run benchmarks, I'd love to hear about possible performance improvements 🙂
Hello, Marko!
To make release and real benchmarks I need a new version of the Jint package that will include fixes for error #667.
Thanks, pinging @sebastienros for a new release
Thanks! Tomorrow I will make release.
In the meantime, here are the results of the JsExecutionBenchmark
benchmark:
Jint v2.11.58
| Method | withPrecompilation | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|------- |------------------- |---------:|----------:|----------:|----------:|----------:|--------:|----------:|
| Jint | False | 24.12 ms | 0.1001 ms | 0.0836 ms | 2781.2500 | 1375.0000 | - | 16.04 MB |
| Jint | True | 14.98 ms | 0.2813 ms | 0.3557 ms | 1281.2500 | 609.3750 | 93.7500 | 7.37 MB |
Jint v3.0.0 Beta 1612
| Method | withPrecompilation | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|------- |------------------- |----------:|----------:|----------:|----------:|------:|------:|----------:|
| Jint | False | 12.698 ms | 0.1049 ms | 0.0930 ms | 1000.0000 | - | - | 7.31 MB |
| Jint | True | 4.917 ms | 0.0915 ms | 0.0940 ms | - | - | - | 2.63 MB |
Jint v2.11.58
| Method | withPrecompilation | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|------- |------------------- |---------:|----------:|----------:|----------:|----------:|--------:|----------:|
| Jint | False | 24.01 ms | 0.3713 ms | 0.3291 ms | 2750.0000 | 1375.0000 | - | 15.92 MB |
| Jint | True | 14.53 ms | 0.2710 ms | 0.2661 ms | 1265.6250 | 593.7500 | 62.5000 | 7.27 MB |
Jint v3.0.0 Beta 1612
| Method | withPrecompilation | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|------- |------------------- |----------:|----------:|----------:|----------:|------:|------:|----------:|
| Jint | False | 12.842 ms | 0.1123 ms | 0.0995 ms | 1000.0000 | - | - | 7.27 MB |
| Jint | True | 5.062 ms | 0.1173 ms | 0.1441 ms | - | - | - | 2.61 MB |
I like these numbers 🥳
Good job Marko, and thanks Andrey.
Thank you @Taritsyn for upgrading, I hope the new version is a worthwhile upgrade.
Could you consider a PR which would change the used Jint version to 3 preview build? Version 3 has:
There would be one obvious breaking change though. The oldest supported .NET full framework version is 4.5, and might even change to something like 4.6.1 later on. But the general guidance seems to be to support .NET 4.6.1 and .NET Standard 2.0, older versions are at the end of the road.