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

Use transform_values to build hash_rows #37614

Merged
merged 2 commits into from
Jan 29, 2020

Commits on Oct 31, 2019

  1. Use transform_values to build hash_rows

    This commit changes hash_rows to build the first row as it did before,
    and then to use transform_values to build subsequent rows, using the
    first as a template.
    
    In Ruby 2.4+ (first version to include transform_values) this is
    marginally faster because the hash will never be realloc'd and the hash
    update logic is probably slightly simpler than add.
    
    In Ruby 2.7+ this is a fair bit faster because transform_values is able
    to run without hashing the keys and only iterates over the values list.
    
    In the case that we only have one row this is only one extra lvar
    set/read and the condition.
    jhawthorn committed Oct 31, 2019
    Configuration menu
    Copy the full SHA
    d495eae View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    911b600 View commit details
    Browse the repository at this point in the history