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

Improve Rails' Shape friendliness (second pass) #47032

Merged
merged 2 commits into from
Jan 17, 2023

Commits on Jan 17, 2023

  1. Improve Rails' Shape friendliness (second pass)

    Followup: rails#47023
    
    ```
    Shape Edges Report
    -----------------------------------
    snip...
           238  @errors
    snip...
           219  @options
    snip...
           129  @_request
           128  @type
           125  @virtual_path
           124  @_assigns
           123  @_config
           123  @_controller
           123  @output_buffer
           123  @view_flow
           122  @_default_form_builder
    snip...
            89  @_already_called
            75  @validation_context
    snip...
            65  @_new_record_before_last_commit
    snip...
            58  @_url_options
    snip...
    ```
    byroot committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    aa7d78d View commit details
    Browse the repository at this point in the history
  2. Make ActiveRecord::Reflection more Shapes Friendly

    Based on a production heap dump, I noticed that while they
    didn't appear in the most common shape edges, reflections classes
    were marked as having 8 or more variations.
    
    This means they are marked as "too_complex" by MRI and fallback to
    not using shapes for instance variable access.
    byroot committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    0b42dab View commit details
    Browse the repository at this point in the history