[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.
[rubygems/rubygems] Remove array allocation from Candidate#<=>
In a large application I profiled allocations while running
bundle updateand found that this method was ~60% of allocations whileresolving (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