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

Optimize engine construction #1621

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

lahma
Copy link
Collaborator

@lahma lahma commented Aug 25, 2023

  • reuse default options instance if no configure defined
  • resolve default time zone and culture only once for options
  • pre-calculate global keys (hash codes), use faster path for dictionary init

Jint.Benchmark.EngineConstructionBenchmark

Diff Method Mean Error Allocated
Old BuildEngine 2.033 μs 0.0198 μs 11.33 KB
New 1.310 μs (-36%) 0.0105 μs 10.62 KB (-6%)
Old EvaluateSimple 2.382 μs 0.0287 μs 12.27 KB
New 1.632 μs (-31%) 0.0154 μs 11.55 KB (-6%)

@lahma lahma merged commit 7fd4893 into sebastienros:main Aug 25, 2023
3 checks passed
@lahma lahma deleted the optimize-engine-construction branch August 25, 2023 05:00
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

Successfully merging this pull request may close these issues.

1 participant