On Jul 18, 2012, at 16:14 , Jeremy wrote:
> I understand, but if one wants to keep a large persistent message allocated 
> and walk over it frequently, there is a price to pay on cache misses that can 
> be significant. 

I guess you are wishing that the memory layout was completely contiguous? Eg. 
if you have three string fields, that their memory would be laid out one field 
after another? Chances are good that with most dynamic memory allocators, if 
you allocate this specific sized message at one time, the fields will *likely* 
be contiguous or close to it, but obviously there are no guarantees. I would 
personally be surprised if these cache misses would be an important performance 
difference, but as normal there is only one way to tell: measure it.

If you want something like this in protobuf though, you would need to change a 
*lot* of the internals. This would not be a simple change. I suggest trying to 
re-use a message, and seeing if the performance is acceptable or not. If not, 
you'll need to find some other serialization solution. Good luck,

Evan

--
http://evanjones.ca/

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to