Skip to content

perf(dart): remove generated struct slot bridge#3653

Merged
chaokunyang merged 4 commits into
apache:mainfrom
chaokunyang:refactor_dart_codegen
May 7, 2026
Merged

perf(dart): remove generated struct slot bridge#3653
chaokunyang merged 4 commits into
apache:mainfrom
chaokunyang:refactor_dart_codegen

Conversation

@chaokunyang
Copy link
Copy Markdown
Collaborator

@chaokunyang chaokunyang commented May 7, 2026

Why?

Dart generated struct serialization had an extra cursor/slot bridge for compatible reads and primitive field runs. That duplicated ownership between generated serializers and the struct serializer layer, added generated/runtime support code, and made the compatible path harder to keep direct.

What does this PR do?

  • Removes the generated cursor and compatible struct slot bridge from the Dart runtime/codegen path.
  • Generates struct serializers that implement GeneratedStructSerializer and handle ordinary and compatible reads directly.
  • Moves compatible struct read mapping to explicit CompatibleStructReadLayout handling, including skipping unknown remote fields.
  • Keeps generated primitive field runs direct by reserving buffer space and writing/reading primitives without cursor helper classes.
  • Simplifies Dart generated/runtime support by deleting obsolete cursor, slot, metadata exposure, and serializer support helpers.
  • Updates Dart tests and xlang implementation guide wording to match the new StructSerializer ownership model.

Related issues

#1017

AI Contribution Checklist

  • Substantial AI assistance was used in this PR: yes / no
  • If yes, I included a completed AI Contribution Checklist 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

image

@chaokunyang chaokunyang force-pushed the refactor_dart_codegen branch from 9b9062f to 446ea5b Compare May 7, 2026 09:15
@chaokunyang chaokunyang merged commit 28a5336 into apache:main May 7, 2026
39 checks passed
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.

2 participants