Skip to content

Commit d5067cc

Browse files
zhangskzcopybara-github
authored andcommitted
Unify MessageSchema.writeFieldsInAscendingOrder proto2 and proto3 methods.
This unifies proto2 and proto3 (and later editions) implementations to incorporate performance optimizations directly referencing unsafe and caching reflection presence field (and offset) to all syntaxes. These optimizations were originally added in cl/187404278 for proto2 only. These optimizations do not seem to be meaningfully proto2/3-specific. The UnsafeUtil methods simply wrap the corresponding Unsafe methods. Presence bit fields are used in the same way for proto3, but this optimization seems to predate proto3 optional. While in there, better document how the buffer encoding and mask/offsets work. PiperOrigin-RevId: 540320373
1 parent 5a48187 commit d5067cc

File tree

1 file changed

+63
-487
lines changed

1 file changed

+63
-487
lines changed

0 commit comments

Comments
 (0)