Using google’s protocol buffer compiler for c++ its not clear which is faster: optimize for speed:
option optimize_for = SPEED;
or optimize for light runtime:
option optimize_for = LITE_RUNTIME;
if speed is faster, what makes it faster?
does anyone have hard data on the subject?
The way I read the documentation,
optimize for CODE_SIZE does not generate fast accessor methods for everything, but relies on slow reflection,
optimize for SPEED will give you the fast accessors
and optimize for LITE_RUNTIME will also give you fast accessors, but does not support the full functionality of protobuf, but only the lighter subset protobuf-lite. Basically, this means descriptors or reflection are not available.
So I guess, LITE_RUNTIME is not slower than SPEED, and you should choose depending on which runtime library you want to require (lite or full).
SPEED is faster compared to CODE_SIZE, because it uses autogenerated code instead of runtime reflection.