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

Performance improvement of strictNullChecks #885

Merged
merged 7 commits into from
Jan 19, 2025
Merged

Conversation

k163377
Copy link
Contributor

@k163377 k163377 commented Jan 19, 2025

Currently, if the strictNullChecks option is enabled, the deserialization performance of collections is significantly degraded.
It also reduces the performance of all deserialization, although very slightly.

The cause of the significant performance degradation is the dynamic definition checks on Kotlin at each deserialization.
Therefore, by moving the processing backend to JsonSetter and limiting the definition checks to initialization time, I have greatly improved performance.

This change closes #719.


The results of the improvements are summarized below.

Benchmark Deterioration rate (before) Deterioration rate (after) Improvement rate
E_5P.empty 0.7383099866 0.9977718738 1.388225409
E_5P.fiveContents 0.7999091212 0.9869712419 1.258111096
T_20P.empty 0.671255694 0.9969159641 1.46163136
T_20P.fiveContents 0.7351224299 1.051081106 1.295783134

Deterioration rate shows the rate of degradation of throughput if the check was enabled.
The closer this is to 1, the smaller the degradation.

Improvement rate shows how much the throughput improved before and after the change when the check was enabled.
The larger this value is, the greater the improvement.

With the new implementation, there is virtually no degradation in throughput even when checks are enabled.
Also, throughput is at least 1.25 times better than before the change.

For a complete benchmark and explanation of the results, please see below.
https://github.com/k163377/strict-null-checks-benchmark

@k163377 k163377 merged commit 6b4b19f into FasterXML:2.19 Jan 19, 2025
15 checks passed
@k163377 k163377 deleted the 719_snc branch January 19, 2025 05:35
@cowtowncoder
Copy link
Member

Excellent progress. Great job, @k163377 !

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.

Performance improvement of strictNullCheck
2 participants