Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance Improvements from ProtoBuf 2.5 #19

Closed
GoogleCodeExporter opened this issue Apr 26, 2015 · 8 comments
Closed

Performance Improvements from ProtoBuf 2.5 #19

GoogleCodeExporter opened this issue Apr 26, 2015 · 8 comments

Comments

@GoogleCodeExporter
Copy link

Version 2.5 is released:
http://protobuf.googlecode.com/svn/trunk/CHANGES.txt


From the release notes:
"Added Parser to parse directly into messages without a Builder. For
    example,
      Foo foo = Foo.PARSER.ParseFrom(input);
    Using Parser is ~25% faster than using Builder to parse messages."


Is it possible to use Parser for a performance gain in protobuf-rpc-pro?

Original issue reported on code.google.com by kryptoni...@gmail.com on 6 Mar 2013 at 6:12

@GoogleCodeExporter
Copy link
Author

I'll look into the upgrade and perf. improvement. Thx for raising attention to 
this.
regards,P.

Original comment by pjklauser@gmail.com on 6 Mar 2013 at 7:25

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

i have to wait a bit for the 2.5.0 to be released to maven central.

Original comment by pjklauser@gmail.com on 7 Mar 2013 at 5:57

@GoogleCodeExporter
Copy link
Author

Here is the ticket for it to be added
https://code.google.com/p/protobuf/issues/detail?id=478

Original comment by kryptoni...@gmail.com on 7 Mar 2013 at 6:20

@GoogleCodeExporter
Copy link
Author

i did an upgrade to 2.5.0 locally and replaced the netty ProtobufDecoder (with 
FastProtobufDecoder attached) to use the PARSER instead of the message builder. 
Unfortunately i couldn't prove that there was any significant performance 
improvement. Maybe this is because the WirePayload i'm serializing is not very 
complex - primarily just a ByteString.

Since i'd like to keep Netty & Protobuf libraries "in-line", i'd prefer to wait 
for Netty to upgrade their support for 2.5.0 and i'll upgrade to the new netty 
version and protobuf 2.5 at the same time.

It would be interesting if Netty developers could test / try to see if they can 
confirm the alleged performance increase of using PARSER.

I checked in my performance test client into the "demo" project.

If you really want the upgrade sooner, just say.

Original comment by pjklauser@gmail.com on 8 Mar 2013 at 8:03

Attachments:

@GoogleCodeExporter
Copy link
Author

Thanks for looking into it.  I will check performance in my test case and get 
back with you.

Original comment by kryptoni...@gmail.com on 9 Mar 2013 at 7:28

@GoogleCodeExporter
Copy link
Author

Upstream is open to a pull request:
https://github.com/netty/netty/issues/1138#issuecomment-14669707

Original comment by kryptoni...@gmail.com on 9 Mar 2013 at 8:21

@GoogleCodeExporter
Copy link
Author

The change is merged in to netty 4.0.  If protobuf 2.5 is available then it 
will use the Parser, else it defaults back to the old behavior.

See this commit:
https://github.com/netty/netty/commit/c25513d5e1dd8eb9906989e83a1ce41495d3e6a9

This ticket can be blocked by ticket #16 (upgrade to netty 4.0) and becomes 
just changing you dependency to protobuf 2.5 if that sounds good to you.


Original comment by kryptoni...@gmail.com on 12 Mar 2013 at 12:26

@GoogleCodeExporter
Copy link
Author

Upgraded to 4.0.0.Beta2 in 3.0.3 version.

Original comment by pjklauser@gmail.com on 16 Mar 2013 at 11:16

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant