-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
latin1StringToBytes: use standard method #4980
Conversation
String#getBytes(StandardCharsets.ISO_8859_1) is ~4% faster than manual copying in loop and one line of java code instead of 6
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.
Can you add the benchmark which shows this is better than the for loop?
import java.util.Objects; | ||
|
||
/** | ||
* @author <a href="http://tfox.org">Tim Fox</a> | ||
* @author <a href="mailto:[email protected]">Lars Timm</a> | ||
*/ | ||
public class RecordParserImpl implements RecordParser { | ||
public final class RecordParserImpl implements RecordParser { |
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.
Please don't change this, it won't change much and is unrelated to the subject of the 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.
IDEA shows me a lot of recommendations and best practices 😥
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.
Well, with Intellij's default, you get thousands of suggestions. It's not wrong to use them, but if you're sending a PR for a specific topic, please focus on 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.
Fixed!✅🤝
@magicprinc you should avoid doing too many changes in your pull requests, just change what is strictly necessary. In practice we need to maintain the code on several branches and changing the way code looks make porting the code more difficult which means that the team porting and reviewing the code spend more time than necessary. From now on we will close any PR that does not do the change advocated in the PR |
@tsegismont I already knew the results, but I have made a benchmark with many explanations for you.
|
@vietj Don't get me wrong: you ignore my PRs or take only few bits from them, and I don't have too much time to spend on this project. We are mostly a "Spring shop", but I hate WebFlux and try to remove it (we have no WebFlux experts and a lot of bug reports). With Vert.x and Virtual Threads, I am on the winning streak, but my colleagues are still very cautious. So please 🙏 accept (with modifications) maybe these (mostly aesthetic) #4980 and And you won't see a PR from me 🥂 (only issues 😅) |
@vietj If we speak about issues: I won't add it to issues, but more integration with https://github.com/smallrye/smallrye-fault-tolerance or vert.x alternative would be great. BTW, We started to use Mutiny, but after some time returned to "bare" Vert.x with occasional Mutiny and some bits from it (mutiny-runtime and mutiny-zero). No offense to Mutiny intended: Mutiny is a breeze of fresh air compared to Spring Reactor/WebFlux. PS: Vert.x 4.5.1 with Jackson Pool is a hot subject. And thank you very much for such a great project! |
@magicprinc then just provide PR that go straight to the point and don't touch code surrounded, we like contribution but we love when they are easy to review and easy to backport. |
also please avoid remerging the main branch in your PR, rather rebase your PR otherwise again it's complicated to port. |
@vietj Please forgive me (and somehow merge) these times. I am really out of new ideas and time, so no more PRs 🙏 |
Squashed and merged in bcddbac |
String#getBytes(StandardCharsets.ISO_8859_1)
is ~4% faster than manual copying in a for loop➕ missing
@Override