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 JSON serialization #1512

Merged
merged 1 commit into from Mar 26, 2023

Conversation

lahma
Copy link
Collaborator

@lahma lahma commented Mar 26, 2023

  • optimize ObjectInstance.GetOwnPropertyKeys for non-sorting case
  • increase StringBuilderPool max capacity check
  • smarter checks for integer numbers in JsonParser

Jint.Benchmark.JsonBenchmark

Diff Method FileName Mean Error Allocated
Old Parse bestbuy_dataset.json 297.742 ms 5.7835 ms 115.01 MB
New 299.811 ms (+1%) 4.3964 ms 114.15 MB (-1%)
Old Stringify bestbuy_dataset.json 142.319 ms 2.2880 ms 104.63 MB
New 127.802 ms (-10%) 1.9511 ms 90.18 MB (-14%)
Old Parse twitter.json 3.023 ms 0.0057 ms 3.64 MB
New 2.995 ms (-1%) 0.0111 ms 3.61 MB (-1%)
Old Stringify twitter.json 2.926 ms 0.0241 ms 2.74 MB
New 2.434 ms (-17%) 0.0118 ms 1.4 MB (-49%)

/cc @tomatosalat0

* optimize ObjectInstance.GetOwnPropertyKeys for non-sorting case
* increase StringBuilderPool max capacity check
* smarter checks for integer numbers in JsonParser
@lahma lahma merged commit abc3646 into sebastienros:main Mar 26, 2023
3 checks passed
@lahma lahma deleted the optimize-get-own-property-keys branch March 26, 2023 10:54
lahma added a commit to lahma/jint that referenced this pull request Mar 26, 2023
* optimize ObjectInstance.GetOwnPropertyKeys for non-sorting case
* increase StringBuilderPool max capacity check
* smarter checks for integer numbers in JsonParser
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.

None yet

1 participant