-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Performance issue with invokedynamic + Rack + URI #2493
Comments
Oops--forgot to mention that the method in question: If changed to return DEFAULT_PORT instead of self::DEFAULT_PORT seems to fix the performance issue. |
The perf improvement from removing self:: means this is likely a problem with how the indy logic compiles the :: form of constant lookup (called "Const2" in our AST). Will investigate. |
Simple answer...there's NO caching at all being done for this form (inheritance_search_const in IR), so the constant and all the invokedynamic method handles to wrap it are getting created every time. |
Hmm actually it looks like we are attempting to cache it until the global constant invalidator fires or the target module is not the same one as last time. Adding some logging, it looks like that invalidation is not working right, or else we're not able to cache this variable properly:
|
See #2495 for a description of the problem. |
While benchmarking a simple Rack app with and without invokedynamic, I noticed that calls to URI::Generic.default_port were taking an excessive amount of time with invokedynamic turned on.
Note 19 seconds spent calling default_port with indy on, vs nothing with it off:
https://gist.github.com/mje113/988f065369dd5693dffb
The text was updated successfully, but these errors were encountered: