Patch #29299

Use Enumerable#sort_by instead of Enumerable#sort

Added by Go MAEDA 3 months ago. Updated 3 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Performance
Target version:4.0.0

Description

According to Fast Ruby, Enumerable#sort_by is much faster than Enumerable#sort. You can read details on https://github.com/JuanitoFatas/fast-ruby#enumerablesort-vs-enumerablesort_by-code.

This patch replaces sort with sort_by to improve performance.

replace-sort-with-sort_by.diff Magnifier (5.04 KB) Go MAEDA, 2018-07-30 18:03

replace-sort-with-sort_by-v2.diff Magnifier (6.71 KB) Go MAEDA, 2018-07-31 02:21

Associated revisions

Revision 17462
Added by Go MAEDA 3 months ago

Replace Enumerable#sort with faster Enumerable#sort_by (#29299).

Patch by Go MAEDA.

History

#2 Updated by Go MAEDA 3 months ago

Updated the patch. Replaced more sort methods.

#3 Updated by Go MAEDA 3 months ago

  • Description updated (diff)

#4 Updated by Go MAEDA 3 months ago

  • Target version set to Candidate for next major release

#5 Updated by Go MAEDA 3 months ago

  • Target version changed from Candidate for next major release to 4.1.0

Setting the target version to 4.1.0.

#6 Updated by Go MAEDA 3 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Target version changed from 4.1.0 to 4.0.0

Also available in: Atom PDF