I'm using a protobuf as the protocol for a distributed system.But now
have some questions about protobuf

a.Whether protobuf provides the inteface for user-defined allocator
because sometimes I find 'malloc' cost too much? I've tried TCmalloc,
but I think I can optimize the memory allocation according to my

b.Whethere protobuf provides a way to serialize a class/object
partially[Or do you have some ideas about it]? Because my application
very sensitive of memory usage.. Such as a class

class Req{
int userid;
vector<PageID> pageid;

I want to pack 1000 pageids into the Req. But if I pack all of them,
Req's size is about 1GB [hypothetically]. But I just have 100MB
so I just plan to pack pageids as many as possible until the memory
usage of Req is about 100MB. ['serialize object partially according to
memory usage'].

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to