.net - Does Protobuf-net tag numbers have performance implications -


i remember once reading tags used protobuf-net have performance implications don't seem find post...

for example, using protoinclude(1001, typeof(mytype)) not efficient protoinclude(101, typeof(mytype))

and same goes members etc.

can please shed light on , maybe give best practice?

thanks,

field numbers in protocol buffers encoded using "varint" encoding. in "varint", msb continuation bit, there 7 bits per byte data. however, first 3 bits reserved field type; means:

  • a 4 bit field number can stored (including field type) in single byte
  • an 11 bit field number can stored in 2 bytes
  • an 18 bit field number can stored in 3 bytes

and on.

decimal 101 7 bit number; decimal 1001 10 bit number; both take 2 bytes per field. that's how overhead works here. other that: doesn't matter.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -