-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Enhancement: Improve toString performance #863
Comments
Simulant87
added a commit
to Simulant87/JSON-java
that referenced
this issue
Feb 22, 2024
Simulant87
added a commit
to Simulant87/JSON-java
that referenced
this issue
Feb 22, 2024
Simulant87
added a commit
to Simulant87/JSON-java
that referenced
this issue
Feb 23, 2024
resulting in a faster toString generation.
Simulant87
added a commit
to Simulant87/JSON-java
that referenced
this issue
Feb 23, 2024
Simulant87
added a commit
to Simulant87/JSON-java
that referenced
this issue
Feb 23, 2024
Simulant87
added a commit
to Simulant87/JSON-java
that referenced
this issue
Feb 24, 2024
Simulant87
added a commit
to Simulant87/JSON-java
that referenced
this issue
Feb 24, 2024
Simulant87
added a commit
to Simulant87/JSON-java
that referenced
this issue
Feb 24, 2024
Simulant87
added a commit
to Simulant87/JSON-java
that referenced
this issue
Feb 24, 2024
Simulant87
added a commit
to Simulant87/JSON-java
that referenced
this issue
Feb 25, 2024
Simulant87
added a commit
to Simulant87/JSON-java
that referenced
this issue
Mar 5, 2024
replacing a switch-case statement with few branches by if-else cases
Simulant87
added a commit
to Simulant87/JSON-java
that referenced
this issue
Mar 5, 2024
Simulant87
added a commit
to Simulant87/JSON-java
that referenced
this issue
Mar 5, 2024
Simulant87
added a commit
to Simulant87/JSON-java
that referenced
this issue
Mar 10, 2024
This reverts commit 6660e40.
Simulant87
added a commit
to Simulant87/JSON-java
that referenced
this issue
Mar 10, 2024
This reverts commit c010033.
Simulant87
added a commit
to Simulant87/JSON-java
that referenced
this issue
Mar 10, 2024
…ing" This reverts commit 5407423.
Simulant87
added a commit
to Simulant87/JSON-java
that referenced
this issue
Mar 10, 2024
This reverts commit 63625b3.
Simulant87
added a commit
to Simulant87/JSON-java
that referenced
this issue
Mar 10, 2024
Simulant87
added a commit
to Simulant87/JSON-java
that referenced
this issue
Mar 10, 2024
I think this could be closed due to implementation complete in #867 |
Closing due to implementation completed in #867 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The toString methods of JSONObject and JSONArray are not very fast, mostly because of the usage of
StringWriter
and the generic code to support an indent, although in the default toString case it is always 0.You can compare the performance of the library e.g. with this comparison project, which also list the results in a graph:
https://github.com/fabienrenaud/java-json-benchmark?tab=readme-ov-file#users-model
My suggestion is to improve the performance for the default toString method without indent by duplicating by using a
StringBuilder
instead of aStringWriter
.The text was updated successfully, but these errors were encountered: