-
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
Use simple parser instead of regex for parsing resolv.conf #5439
base: master
Are you sure you want to change the base?
Conversation
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.
Thank you @geoand
Have you got a chance to write a micro-benchmark and compare results?
Not yet |
Actually I am not sure what a microbenchmark would look like in this case as I've removed the old methods and replaced them with a single one that extracts the necessary data in one pass. @franz1981 how do you usually handle cases like this? Moreover, do you think a microbenchmark is even necessary in this case? |
That's how I do it: https://github.com/franz1981/java-puzzles/blob/74d60bbb8639ccbc1158046ce8d5575720bca96c/src/main/java/red/hat/puzzles/cstatic/StaticInt.java You can use -prof jfr:dir=profile-results;configName=jfr-profile.jfc And use JMC to read the class loading events and compilation events or just using both -prof cl -prof comp instead (which are easier to use tbh) These are very tricky benchmarks since:
Which means, make sure the effect you want to measure is big enough that observing it, reproduces it with fidelity and is not absorbed by the infrastructure cost |
In this case what I think @tsegismont was asking for was just a comparison of the parsing from String |
It does seem however that this is causing more allocations so I'll see what I can do |
Ideally I would want this in Vert.x 4 as well :) |
It would have two methods comparing the code inside
I'm not an expert but it seems both diagrams use |
Correct.
I could have also used a base lower down the call stack that would show that |
HostnameResolver
class initialization is pretty heavy #5429