Skip to content
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

No longer rely on refinements for Hash utility methods. #573

Merged
merged 1 commit into from Nov 7, 2021

Commits on Aug 24, 2021

  1. No longer rely on refinements for Hash utility methods.

    Refinements have a very significant performance overhead.
    The simple fact of refining a method, even if the refinement
    is never used will make calls to that method 40% slower.
    
    On rarely called methods in doesn't matter that much, but I18n
    refine some popular Active Support methods, so any project including
    the I18n gem suffer from a significant performance penalty.
    
    See this benchmark for more details:
    https://gist.github.com/casperisfine/1c46f05cccfa945cd156f445f0d3d6fa
    
    In the end these refinements are easily replace by simple module functions
    taking one extra argument.
    byroot committed Aug 24, 2021
    Copy the full SHA
    3104705 View commit details
    Browse the repository at this point in the history