-
Notifications
You must be signed in to change notification settings - Fork 229
feature/add-benchmark-case-for-deserialize-and-large #241
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
feature/add-benchmark-case-for-deserialize-and-large #241
Conversation
Just FYI I'm currently working on seeing if I can use mypyc to compile the code I'm interested to see what performance it yields. |
As an update here are the numbers, they aren't very good although I think it's just because mypyc doesn't support native byte(array) methods
|
@Gobot1234 that's... Interesting |
Could I get a review for this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @KennethanCeyer Thanks for working on this and sorry for the slow response.
Have you considered using Cython? All else being equal I think it would be the preferable way to compiled performance gains for parsing. The reason being that adding other languages would complicate distribution and maintenance of betterproto going forward.
mypyc now supports native operations on bytearray, the numbers for this now look a lot better. |
@nat-n |
@KennethanCeyer Any update on the cython front? I'd be more than happy to do this myself with the new cython pep 484 type hint support stuff to avoid a lot of duplication. |
Background
When attempting to parse the List[bytes] type as betterproto, approx. 1,000 elements or more. 500ms is required.
Our service needs to parse more than 1,000 unit bytes using betterproto, and it was determined that it would be a problem for the business to require more than 500ms of resources for each request, so I decided to improve the parse function of betterproto.
Therefore, it is necessary to know the baseline for deserialize performance improvement before working on improvement proposals in subsequent PR. In betterproto, we added benchmark cases for three message cases (simple message, nested message, repeated message) and worked on this PR. First, we want to merge them to get the baseline.
In the future, I will proceed with the following attempts.
parse
methodFeatures
Add benchmark cases as follows
How to test