Hello,

I have a message type like this:

message SearchResponse {
    enum Status {
        OK = 200;
        BAD_REQUEST = 400;
        REQUEST_TIMEOUT = 408;
        INTERNAL_SERVER_ERROR = 500;
    }
    required Status status = 1;

    message Result {
        required int32 docid = 1;
        optional float score = 2;
    }
    repeated Result result = 2;
}

Now it it possible that the result repeats 5.000.000 times or more. At the 
moment I'm working with about 2.100.000 repeats and the 
ParseFromCodedStream function takes about 25 seconds.

My Code looks like:

google::protobuf::io::ArrayInputStream arrayIn(buffRecive, recived);
google::protobuf::io::CodedInputStream codedIn(&arrayIn);
google::protobuf::io::CodedInputStream::Limit msgLimit = 
codedIn.PushLimit(recived);
srchResp.ParseFromCodedStream(&codedIn);
codedIn.PopLimit(msgLimit);

The parsing and everything works great, but the performance is the problem. 
The message with 2.100.000 repeats has around 2.600.000 bytes.
Is there a way to improve the performance?

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to