-
-
Notifications
You must be signed in to change notification settings - Fork 285
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 issue tracking #116
Comments
Thanks for filing this. At this point, we haven't done much to optimize the performance of ScalaPB but it's been on my mind. It would be really nice to have an example benchmark we can work with. |
I will try to do benchmarks and to experiment making But not right now. |
Can you share some details on the message that caused the slow serializedSize time? Deeply nested? Big arrays? Maps? One ofs? Anything else? |
I don't know yet because I did not do exact benchmarking. |
Okay, I've done some benchmarking. Project: https://github.com/eiennohito/scalapb-jmh-bench For the test data I use three level nesting:
I run tests on JDK 1.8.0_92, Xeon E5-2667 v3, CentOS 6.7
Basically there is +20microsec/op on calculating size and +10microsec/op on serializing the object itself. I will use this project for the further analysis. |
Benchmarking serializedSizeMethodology:
Benchmarks:
Conditions:
DiscussionI did this test on a bit older hardware. Here is a full histogram for lazy val is slowBy replacing
|
If you don't mind, I will replace current generation of serializedSize by something on the lines of eiennohito/scalapb-jmh-bench@e17979e |
lazy vals are replaced by transient backing fields with -1 as sentinel value and lazy initialization in accessor methods The best low hanging fruit for scalapb#116 right now. Motivation for the fix is described in the scalapb#116
I think we should either close this issue or rename it to something like "Performance issues: Tracking" |
Is there a bench marking results with most recent library version ? I have a big protobuf file that has 174MB size, however takes 4 seconds to deserialize it , but python takes 2 millis for the same |
We haven't run the benchmarks for a while, but there weren't changes that would warrant a regression from 0.10.x. Of course, everything is possible. Can you create a minimal example project with a protobuf that would take 4 seconds to deserialize in Scala while it's 2 millis in python (or something that demonstrate an inefficiency)? |
Hello @thesamet the python code for the same takes 2 seconds, not 2ms , sorry for the wrong information . |
It takes a lot in profiles. 3-4 times more than actual serialization of the message (writeTo).
However, before doing anything need to write a benchmark for this.
The text was updated successfully, but these errors were encountered: