Since you haven't provided any code it's hard to speculate on what may be going wrong. On Wed, Sep 9, 2009 at 3:01 PM, rajesh <poorv...@gmail.com> wrote:
> > > Hi All, > I ran some performance tests to compare the performance for > serializing-persisting-retrieving-desirializing of my POJOs and was > really surprised to see that java-serialization was performing better > than protobuf-serialization. Iam enclosing my proto file based on > which Iam generating my proto buffer messages. > > ----------- protofile--------------------------- > option java_package = "com.equifax.ic.eid.iq.persist.generated"; > option java_outer_classname = "AllQuestionPackImplProtos"; > option optimize_for = SPEED; > > message AllQuestionPacksImpl{ > optional string transid = 1; > repeated QuestionPack realQuestionPacks = 2; > repeated QuestionPack simulatedQuestionPacks = 3; > } > > message QuestionPack{ > optional string transkey = 1; > optional bool simulated = 2; > optional GeneratorNameEnum generatorNameType = 3; > optional PersistableQuestion persistableQuestion = 4; > repeated PersistableQuestion options = 5; > optional PersistableHeader persistableHeader = 6; > > enum GeneratorNameEnum { > GENERATOR_CONDITIONAL_CANADA_AUTO = 0; > GENERATOR_CONDITIONAL_CANADA_GAS_CARD = 1; > GENERATOR_CONDITIONAL_CANADA_PERSONAL_LINE_OF_CREDIT = 2; > GENERATOR_CONDITIONAL_CANADA_PERSONAL_LOAN = 3; > GENERATOR_CONDITIONAL_CANADA_STUDENT_LOAN = 4; > GENERATOR_FICTIONAL_CANADA_AUTO = 5; > GENERATOR_FICTIONAL_CANADA_GAS_CARD = 6; > GENERATOR_FICTIONAL_CANADA_PERSONAL_LINE_OF_CREDIT = 7; > ... > ... > } > message PersistableHeader { > optional TextParametrization text = 1; > } > > message TextParametrization{ > optional string asString = 1; > optional string fixedText = 2; > repeated Parameter parameter =3; > optional InteractiveQueryResourceEnum resourceId = 4; > > message Parameter{ > optional string value = 1; > } > > enum InteractiveQueryResourceEnum{ > MONTH_1 = 0; > MONTH_2 = 1; > MONTH_3 = 2; > MONTH_4 = 3; > MONTH_5 = 4; > MONTH_6 = 5; > MONTH_7 = 6; > MONTH_8 = 7; > ... > .. > } > } > > message PersistableQuestion{ > optional bool real = 1; > repeated PersistableChoice coices = 2; > optional QuestionType questionType = 3; > optional PersistableHeader persistableHeader = 4; > optional TextParametrization text = 5; > > > > > message PersistableChoice{ > optional bool correct = 1; > optional int32 sortOrder = 2; > optional string simpleText = 3; > optional TextParametrization resourceTextValue = 4; > > } > > > enum QuestionType{ > US_MORTGAGE_PROVIDER_REAL = 0; > US_MORTGAGE_PROVIDER_FICTIONAL = 1; > US_MORTGAGE_PAYMENT_REAL = 2; > US_MORTGAGE_PAYMENT_FICTIONAL = 3; > US_AUTO_PROVIDER_REAL = 4; > US_AUTO_PROVIDER_FICTIONAL = 5; > US_AUTO_PAYMENT_REAL = 6; > ... > ... > } > } > } > ------------protofile----------------------- > > To reduce the verbosity I have not included all the elements of my > Enums. But as you can see I have large enums. I have included the > option 'option optimize_for = SPEED;' to optimize the proto buffer > for speed, but in vain. The steps I performed are : > > 1) Compiled the proto fileagainst the protobuf binary to generate the > source. > 2) Built my proto message Objects based on the source and the POJO. > 3)Serialized the proto message objects > 4) Persisted proto message objects to the the Db. > 5) Retrieved the blob, desirialized to the proto message object. > 6) Built the pojo back from the proto message object. > > Steps 2 + 3 +4 are found to be more performance expensive than if I > use java serialization to do the same, same for the retrieval > process. > > Is there anything which Iam missing? How do I optimize the proto > buffer to achieve performance. > > Any insights/ help on this is highly appreciated. > > Thanks in advance. > > > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---