You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fory.apache.org by "yash-agarwa-l (via GitHub)" <gi...@apache.org> on 2026/04/14 07:40:22 UTC
[PR] perf(dart): optimize struct deserialize with direct dispatch codegen [fory]
yash-agarwa-l opened a new pull request, #3563:
URL: https://github.com/apache/fory/pull/3563
<!--
**Thanks for contributing to Apache Fory™.**
**If this is your first time opening a PR on fory, you can refer to [CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md).**
Contribution Checklist
- The **Apache Fory™** community has requirements on the naming of pr titles. You can also find instructions in [CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md).
- Apache Fory™ has a strong focus on performance. If the PR you submit will have an impact on performance, please benchmark it first and provide the benchmark result here.
-->
## Why?
Fory struct deserialize in Dart was slower than it should be given Fory's wire format.
## What does this PR do?
- Codegen emits direct read calls for statically safe struct/ext fields, skipping runtime
flag and type switches (mirrors Java's ObjectCodecBuilder).
- Runtime replaces a one-key HashMap on ReadContext/WriteContext with a dedicated field.
- Fixes benchmark workload file broken by the #3560 constructor refactor.
## Related issues
#3558
## AI Contribution Checklist
- [ ] Substantial AI assistance was used in this PR: `yes` / `no`
- [ ] If `yes`, I included a completed [AI Contribution Checklist](https://github.com/apache/fory/blob/main/AI_POLICY.md#9-contributor-checklist-for-ai-assisted-prs) in this PR description and the required `AI Usage Disclosure`.
- [ ] If `yes`, my PR description includes the required `ai_review` summary and screenshot evidence of the final clean AI review results from both fresh reviewers on the current PR diff or current HEAD after the latest code changes.
## 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org
Re: [PR] perf(dart): optimize struct deserialize with direct dispatch codegen [fory]
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang merged PR #3563:
URL: https://github.com/apache/fory/pull/3563
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org
Re: [PR] perf(dart): optimize struct deserialize with direct dispatch codegen [fory]
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on PR #3563:
URL: https://github.com/apache/fory/pull/3563#issuecomment-4244036756
Yes, submit a pr would be great. We welcome all pull requests which improve performance
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org
Re: [PR] perf(dart): optimize struct deserialize with direct dispatch codegen [fory]
Posted by "yash-agarwa-l (via GitHub)" <gi...@apache.org>.
yash-agarwa-l commented on PR #3563:
URL: https://github.com/apache/fory/pull/3563#issuecomment-4242102555
Benchmark
<img width="4200" height="900" alt="throughput" src="https://github.com/user-attachments/assets/1b1f932d-5272-4ac9-881e-58564a64b5c2" />
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org
Re: [PR] perf(dart): optimize struct deserialize with direct dispatch codegen [fory]
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on PR #3563:
URL: https://github.com/apache/fory/pull/3563#issuecomment-4243808231
@yash-agarwa-l Please submit a pr to update docs/benchmarks/dart
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org
Re: [PR] perf(dart): optimize struct deserialize with direct dispatch codegen [fory]
Posted by "yash-agarwa-l (via GitHub)" <gi...@apache.org>.
yash-agarwa-l commented on PR #3563:
URL: https://github.com/apache/fory/pull/3563#issuecomment-4244029054
i have made the PR, I was also working of few more improvements, if it improves the benchmark for struct, should I make a PR?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org