cprotobuf
cprotobuf copied to clipboard
Document how to access internal dict for faster reads
Currently, todict makes a copy of the full structure. Simply accessing (or documenting) the internal dict is much faster than using setattr/getattr and reflection.
Why not post some code, i'm not sure exactly what you propose. ;D
This may not even need code; it's simply a documentation note now.
entity.__dict__
is faster, when appropriate, for accessing fields than using setattr/getattr or creating a dictionary through:
entity.todict()
__dict__
is different from todict
, you get a object instance for submessage instead of dict.