Skip to content

[Rust] Struct Performance Optimization #3569

@chaokunyang

Description

@chaokunyang

Feature Request

No response

Is your feature request related to a problem? Please describe

Currently fory rust have a buffer bound check for each struct field, but for numeric fields, the max possible binary length can be computed in advance at macro processing time. So we can compute max possible length in advance and grow buffer once, then write to buffer directly, and commit writer index after all numeric/bool fields has been written

Describe the solution you'd like

Take java/c++ struct fields serialization as reference:

  • java: BaseObjectCodecBuilder.java
  • C++: struct_serializer.h

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions