Skip to content

Performance Regression in 3.4.1 #1537

Closed
@dougal

Description

@dougal

While running specs on a large application I maintain, I noticed a significant slowdown in running controller specs where the action would ordinarily render a template, when using 3.4.1 as compared to 3.4.0.

I have provided an example application which demonstrates this.

Benchmarking

The results I am seeing (using the timing in RSpec's own output) are:

3.4.0

Run 1: 2.51s
Run 2: 2.55s
Run 3: 2.54s

Average: 2.53s

3.4.1

Run 1: 6.99s
Run 2: 7.04s
Run 3: 7.06s

Average: 7.03s

Conjecture

I suspect this is related to the changes in PR #1535, specifically the commit 42b44a6. Having a quick look at the commit, there are at least two extra map operations in there compared to previously. I am not familiar with the code, and have not yet had the time to run a profiler with the specs in my example application to see if the extra iteration or resulting allocations are indeed the cause. I hope to do so tomorrow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions