chobie / php-protocolbuffers

PECL ProtocolBuffers
pecl.php.net/package/protocolbuffers
Other
128 stars 38 forks source link

Parsing large message might cause performance down. #29

Open chobie opened 10 years ago

chobie commented 10 years ago

ProtocolBuffersMessage class design is fully representation protocol buffers message into PHP classes. this makes easy to use with PHP. you can easily to customize message class, convert message into another format.

but this also means parsing large (has many child message) message will slow down performance (it takes many memories and times). imagine creating 10000 of complicated child message when parsing the data. It's really tough work.

when you want to use this with web services. then you should keep 1 message size between 1.5K ~ 10Kbytes with gzip. (I recommend under 3Kbytes).

see also: https://developers.google.com/protocol-buffers/docs/techniques#large-data