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
Improve performance by removing respond_to? from runtime code #45578
Improve performance by removing respond_to? from runtime code #45578
Conversation
863fd1d
to
326f44a
Compare
respond_to? is inherently slow, and the YAML class won't change whether it does or does not respond to unsafe_load, so just check it once during file load, and define methods accordingly.
326f44a
to
f8f5c43
Compare
Is this worth a x.x.x.2 release? I'm honestly unsure how big of a performance difference this is. It's sort of a regression fix for the security release that went out today. But maybe it's not enough of a deal to warrant a release. |
No it's not. The performance difference isn't that big to really matter that much. I'll merge tomorrow, but probably won't bother backporting. |
Makes sense. Thanks! |
…ance Improve performance by removing respond_to? from runtime code
…ance Improve performance by removing respond_to? from runtime code
…ance Improve performance by removing respond_to? from runtime code
…ance Improve performance by removing respond_to? from runtime code
respond_to? is inherently slow, and the YAML class won't change whether
it does or does not respond to unsafe_load, so just check it once
during file load, and define methods accordingly.
cc @byroot