I noticed the following need in PWA code (and other code, at least 'sync' and likely other places) for extra support for protobuf messages not included in the MessageLite implementation, like:
- Equality operator
- Debug value generation (to base::Value, or at least to string)
- in-memory size estimation
- (more?)
As well as, in general, the usage of proto message in chromium doesn't seem to really need performance (not like mojom does). But - there might be exceptions.
I did a brief exploration on:
- Before 'making a new thing', what would it take to change us from LITE_RUNTIME to SPEED or CODE_SIZE, which should provide these methods?
- If not possible, what other solutions can we roll for folks who need these things?
I didn't have enough time to make this too thorough or make the doc very good, but if others are interested in this, you can check out my findings at
Equality, Debug Serialization, and Size Estimation in Protobufs, LITE_RUNTIME. In the end it was too complicated for me to build Chromium protobufs in a different configuration in a non-trivial amount of time, so I gave up trying to do that (but wrote down the problems).
My initial conclusion here is that for PWA we are going to roll something like
this CL to generate "<ProtoMessage>Extras" compile-time types with this functionality. This at least will be a zero-cost thing for us as we can delete our current custom-rolled code. Perhaps we can also migrate the sync system to this to further possibly reduce code size.
If others want to pick this up and do the unknown-full-complexity-work of "determine the cost & benefits for migrating Chromium's protobuf library away from LITE_RUNTIME and possibly to CODE_SIZE", then here is some initial work to get you started.