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

Benchmark new matcher DSL implementation against 2.14's implementation #338

Closed
myronmarston opened this issue Oct 9, 2013 · 0 comments · Fixed by #340
Closed

Benchmark new matcher DSL implementation against 2.14's implementation #338

myronmarston opened this issue Oct 9, 2013 · 0 comments · Fixed by #340
Assignees

Comments

@myronmarston
Copy link
Member

It's worth knowing if we improved at all.

@ghost ghost assigned myronmarston Oct 13, 2013
myronmarston added a commit that referenced this issue Oct 15, 2013
Results are includde for:

- MRI 2.0.0, MRI 1.9.3, JRuby 1.7.4
- Against 2.14.3, 3.0.0.pre before matcher DSL rewrite, 3.0.0.pre after matcher DSL rewrite

Conclusions:

* Getting an instance of a custom matcher was insanely slow in 2.x,
  and it looks like the `making_declared_methods_public` hack for 1.8.6
  was the primary source of that. Without that, getting an instance of
  a matcher is ~20x faster. To see what changed between 2.14.3 and
  the commit used for this benchmark, go to:
  v2.14.3...4c47e4c#diff-a51020971ade2c87f1d5b93f20d711c7L6
* With our new custom matcher DSL, using a matcher is approximately
  the same perf. However, defining a matcher is about 10x slower
  (since it defines a subclass) while getting an instance of
  an already defined matcher is about 10x faster.

Overall, I think this is a net win, because users almost certainly
use existing matchers more often then they define them.  (The exception
would be if they define custom matchers they don't use, but that
would be very odd).

Closes #338.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant