NSAmelchev opened a new pull request, #13848:
URL: https://github.com/apache/ignite/pull/13848

   Every generated serializer of a message without `@ImmutableSchema` calls 
`MessageSerializationContext#includeRawFields()` on write and on read, and each 
field gated by `@Order(deprecatedBy = ...)` or `@Order(introducedBy = ...)` 
adds its own check. `IgniteMessageSerializationContext` answers all of them 
through a `HashMap` lookup by component name, and the lookup is inlined into 
every check site of a serializer. IGNITE-29286 puts the first feature-gated 
fields on the transaction path, so these checks become part of every 
transaction.
   
   - `includeRawFields()` is resolved once when the context is built.
   - The context of the core component is kept in a field, so checks of core 
features skip the map.
   - The generated reader of a message with feature-gated fields no longer 
calls `rawFields.removeIf(...)` on an empty raw-field list: the call allocated 
a capturing lambda on each read.
   
   The wire format and `toString()`, `equals()`, `hashCode()` of the context do 
not change.
   
   JMH, serialization through `DirectMessageWriter` and `DirectMessageReader` 
with the context of two nodes of the same version, measured on top of 
IGNITE-29286:
   
   | | Before | After |
   |---|---|---|
   | `includeRawFields()` | 1.77 ns | 0.51 ns |
   | `includeFieldDeprecatedBy()` | 1.75 ns | 0.78 ns |
   | `GridDhtTxFinishResponse` (no gated fields), write | 46.0 ns | 44.1 ns |
   | `GridDhtTxFinishResponse`, read | 92.9 ns | 90.9 ns (within noise) |
   | `GridDhtTxFinishRequest` (three gated fields), write | 98.8 ns | 87.8 ns |
   | `GridDhtTxFinishRequest`, read, context change | 152.8 ns | 134.7 ns |
   | `GridDhtTxFinishRequest`, read, generator change on top | 132.7 ns, 336 B 
| 127.4 ns, 312 B |
   


-- 
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]

Reply via email to