-
Notifications
You must be signed in to change notification settings - Fork 34
Transcoding optimizations #173
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
base: main
Are you sure you want to change the base?
Transcoding optimizations #173
Conversation
I think we could write a JMH benchmark for this |
I have been thinking about benchmarks for gRPC in general because there are TechEmpower tests which are testing Vert.x, but we don't really have a comparison of vertx-grpc with, for example, the grpc-ecosystem version. That beign said, I don't think this is a major optimization because in general this only reduces some unnecessary calls, and in PercentEncoding it just puts the reserved chars to BitSet away from switch (which might make it a bit slower than using switch, but at the same time this way it is more readable, I think). Also if there was something for percent encoding already I would use that but I didn't really find anything in google lib it only provides escapers and not unescapers. |
here I am thinking about microbenchmarking the convertion without gRPC transport itself |
Yeah, I can look into that 👍 |
we might be surprised by having extra bytes copy happening |
Well, I have added some basic benchmarks (I used Vertx core for the setup) and I have run the tests with old and the new. For MessageWeaver class, the new version is faster, but PercentEncoding class is seems slower. I will try to look into that. |
5b68f47
to
e7a1874
Compare
4649b2c
to
9b5f7b8
Compare
9b5f7b8
to
20c62e2
Compare
return false; | ||
} | ||
} | ||
// RFC 3986 reserved characters: gen-delims and sub-delims |
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.
where is this copied from ?
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.
It is in referenced in line underneath it, basically RFC 6570 and RFC 3986 are the same, in terms of reserved characters as RFC 6570 builds upon RFC 3986 I think?, but I find RFC3986 having little bit more explanation.
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.
did you implement it ?
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.
What do you mean?
20c62e2
to
a4ce83b
Compare
6feb69c
to
50dfd79
Compare
50dfd79
to
6aaae6c
Compare
Signed-off-by: Daniel Fiala <[email protected]>
Signed-off-by: Daniel Fiala <[email protected]>
6aaae6c
to
79c1e69
Compare
Motivation:
This PR optimizes some transcoding utility classes and added more test to path matcher test class.