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

perf(java): optimize pojo copy performance #1739

Merged
merged 7 commits into from
Jul 20, 2024

Conversation

chaokunyang
Copy link
Collaborator

@chaokunyang chaokunyang commented Jul 20, 2024

What does this PR do?

optimize pojo copy performance by 1~4X and add copy benchmark

Related issues

Does this PR introduce any user-facing change?

  • Does this PR introduce any public API change?
  • Does this PR introduce any binary protocol compatibility change?

Benchmark

Before:

Benchmark                (bufferType)   (objectType)  (references)   Mode  Cnt        Score         Error  Units
CopyBenchmark.fury_copy         array  MEDIA_CONTENT         false  thrpt    3  1294614.644 ± 2103796.392  ops/s
CopyBenchmark.fury_copy         array         SAMPLE         false  thrpt    3  1909071.799 ± 2343118.356  ops/s
CopyBenchmark.fury_copy         array         STRUCT         false  thrpt    3  1220680.635 ± 1019806.837  ops/s
CopyBenchmark.fury_copy         array        STRUCT2         false  thrpt    3   584429.541 ±  111229.502  ops/s
CopyBenchmark.kryo_copy         array  MEDIA_CONTENT         false  thrpt    3  1008490.635 ±  309047.316  ops/s
CopyBenchmark.kryo_copy         array         SAMPLE         false  thrpt    3   921863.274 ± 1082442.180  ops/s
CopyBenchmark.kryo_copy         array         STRUCT         false  thrpt    3  1336939.990 ±  795836.830  ops/s
CopyBenchmark.kryo_copy         array        STRUCT2         false  thrpt    3   168367.000 ±  236966.711  ops/s

Java

Benchmark                (bufferType)   (objectType)  (references)   Mode  Cnt        Score         Error  Units
CopyBenchmark.fury_copy         array  MEDIA_CONTENT         false  thrpt    3  2201830.808 ± 4640532.805  ops/s
CopyBenchmark.fury_copy         array         SAMPLE         false  thrpt    3  4945272.027 ± 5429361.187  ops/s
CopyBenchmark.fury_copy         array         STRUCT         false  thrpt    3  4809373.970 ± 6803285.896  ops/s
CopyBenchmark.fury_copy         array        STRUCT2         false  thrpt    3  2577391.052 ± 6682601.210  ops/s
CopyBenchmark.kryo_copy         array  MEDIA_CONTENT         false  thrpt    3   830059.189 ± 2509547.599  ops/s
CopyBenchmark.kryo_copy         array         SAMPLE         false  thrpt    3   696901.072 ±  525070.309  ops/s
CopyBenchmark.kryo_copy         array         STRUCT         false  thrpt    3   980635.311 ± 2495689.418  ops/s
CopyBenchmark.kryo_copy         array        STRUCT2         false  thrpt    3   141996.627 ±  343339.930  ops/s

@chaokunyang
Copy link
Collaborator Author

image
@zhaommmmomo There are still many improvements can be done, you can dive into it if you have time .

@chaokunyang chaokunyang merged commit 5e0b8a9 into apache:main Jul 20, 2024
32 checks passed
chaokunyang added a commit that referenced this pull request Jul 20, 2024
## What does this PR do?

This PR supports jdk17+ record copy

## Related issues

#1739 
#1701 

Closes #1740

## Does this PR introduce any user-facing change?

<!--
If any user-facing interface changes, please [open an
issue](https://github.com/apache/fury/issues/new/choose) describing the
need to do so and update the document if necessary.
-->

- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?


## Benchmark

<!--
When the PR has an impact on performance (if you don't know whether the
PR will have an impact on performance, you can submit the PR first, and
if it will have impact on performance, the code reviewer will explain
it), be sure to attach a benchmark data here.
-->
@zhaommmmomo
Copy link
Contributor

图像 @zhaommmmomo还有很多改进空间,如果你有时间,可以深入研究。

This is very good, I will continue to optimize it.

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.

3 participants