Project

General

Profile

« Previous | Next » 

Revision 8cc85dc0

Added by Hartley McGuire 8 months ago

[rubygems/rubygems] Remove array allocation from Candidate#<=>

In a large application I profiled allocations while running bundle update and found that this method was ~60% of allocations while
resolving (and Candidate#<=> is almost half of the total runtime).

This commit removes the array allocation in Candidate#<=> (and similar
methods since the implementations are so simple). The array is always
the same two elements so they can just be compared directly.

https://github.com/rubygems/rubygems/commit/6a7c411ba7