-
-
Notifications
You must be signed in to change notification settings - Fork 560
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into issue729-toLocaleString-withArgs
- Loading branch information
Showing
213 changed files
with
4,535 additions
and
1,870 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Project> | ||
|
||
<PropertyGroup> | ||
<UseArtifactsOutput>true</UseArtifactsOutput> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> | ||
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageVersion Include="BenchmarkDotNet" Version="0.13.10" /> | ||
<PackageVersion Include="Esprima" Version="3.0.2" /> | ||
<PackageVersion Include="Flurl.Http.Signed" Version="3.2.4" /> | ||
<PackageVersion Include="Jurassic" Version="3.2.7" /> | ||
<PackageVersion Include="Meziantou.Analyzer" Version="2.0.106" /> | ||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" /> | ||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" /> | ||
<PackageVersion Include="MongoDB.Bson.signed" Version="2.19.0" /> | ||
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" /> | ||
<PackageVersion Include="NiL.JS" Version="2.5.1674" /> | ||
<PackageVersion Include="NodaTime" Version="3.1.9" /> | ||
<PackageVersion Include="NUnit" Version="3.14.0" /> | ||
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" /> | ||
<PackageVersion Include="SharpZipLib" Version="1.4.0" /> | ||
<PackageVersion Include="Spectre.Console.Cli" Version="0.45.0" /> | ||
<PackageVersion Include="System.Text.Json" Version="6.0.8" /> | ||
<PackageVersion Include="Test262Harness" Version="0.0.22" /> | ||
<PackageVersion Include="xunit" Version="2.6.1" /> | ||
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" /> | ||
<PackageVersion Include="YantraJS.Core" Version="1.2.203" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<GlobalPackageReference Include="GitHubActionsTestLogger" Version="2.3.3" /> | ||
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" /> | ||
<GlobalPackageReference Include="PolySharp" Version="1.13.2" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,36 @@ | ||
using BenchmarkDotNet.Attributes; | ||
using Esprima; | ||
using Esprima.Ast; | ||
using Jint.Native; | ||
|
||
namespace Jint.Benchmark; | ||
|
||
[MemoryDiagnoser] | ||
public class EngineConstructionBenchmark | ||
{ | ||
private readonly Script _program; | ||
private Script _program; | ||
private Script _simple; | ||
|
||
public EngineConstructionBenchmark() | ||
[GlobalSetup] | ||
public void GlobalSetup() | ||
{ | ||
var parser = new JavaScriptParser(); | ||
_program = parser.ParseScript("return [].length + ''.length"); | ||
_program = parser.ParseScript("([].length + ''.length)"); | ||
_simple = parser.ParseScript("1"); | ||
new Engine().Evaluate(_program); | ||
} | ||
|
||
[Benchmark] | ||
public double BuildEngine() | ||
public Engine BuildEngine() | ||
{ | ||
var engine = new Engine(); | ||
return engine.Evaluate(_program).AsNumber(); | ||
return engine; | ||
} | ||
|
||
[Benchmark] | ||
public JsValue EvaluateSimple() | ||
{ | ||
var engine = new Engine(); | ||
return engine.Evaluate(_simple); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.