-
Notifications
You must be signed in to change notification settings - Fork 790
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
chipping away at the perf regression #4286
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.
Has this been identified as a hotspot, or is it speculative? Either way, I agree with 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.
Nope, it hung a test, but I think I see why.
@@ -255,6 +255,7 @@ object Uri extends UriPlatform { | |||
} | |||
} | |||
|
|||
private[http4s] val uriReferenceUtf8: Parser0[Uri] = uriReference(StandardCharsets.UTF_8) |
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.
I bet making this lazy unhangs it. Otherwise, catch it hanging locally and jstack it and you can figure out the circular dependency.
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.
I guess we could get away with only val
s but that would mean reordering all the parsers 😞
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 immediately showed up as a hotspot in jvisualvm. Turns put recreating parsers is expensive |
Okay, that's great to learn. I wonder if we have any more def parsers out there. |
A quick search didn't reveal any but my grep foo isn't very strong ;) |
use oneof instead of cascading, memoize uri parser construction