chaokunyang opened a new issue, #3000:
URL: https://github.com/apache/fory/issues/3000

   ### Feature Request
   
   create @ForyField annotation to provide extra meta for perf/space 
optimization
   
   ### Is your feature request related to a problem? Please describe
   
   _No response_
   
   ### Describe the solution you'd like
   
   If we can add `@ForyField` to field of struct like:
   ```java
   class Foo {
     @ForyField(nullable=False, id=0)
     f1: String;
      @ForyField(nullable=False, ref=False, id=1)
     f2: Bar
   }
   ```
   
   Then when serialization, we can:
   1. for field `f1`: 
     - skip write null flag, save 1 byte; 
     - for compatible mode, use id `0` to encode field name instead field_name 
`f1`. When field_name `f1` is long, it can take more space.
   3. for field `f2`: 
     - avoid put f2 to `IdentifyMap` if ref tracking is enabled, this can save 
hashmap cost
     - avoid write ref/null flag: save 1 byte
     -   for compatible mode, use id `1` for field name can save field name 
space cost
   
   
   protocol spec can be found at: 
https://fory.apache.org/docs/next/specification/fory_xlang_serialization_spec#field-header
   
   <img width="1650" height="1096" alt="Image" 
src="https://github.com/user-attachments/assets/991f0ae4-ba2f-4b58-8eac-c084281c3833";
 />
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to