<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/benchmark/enum_sort_by.yml, branch v4.0.4</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[Feature #19643] Direct primitive compare sort for `Array#sort_by`</title>
<updated>2023-05-20T10:40:27+00:00</updated>
<author>
<name>nekoyama32767</name>
<email>60657593+nekoyama32767@users.noreply.github.com</email>
</author>
<published>2023-05-20T10:40:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=87217f26f120611d009f1b178d3cc5eaf1b8b515'/>
<id>87217f26f120611d009f1b178d3cc5eaf1b8b515</id>
<content type='text'>
In most of case `sort_by` works on primitive type.
Using `qsort_r` with function pointer is much slower than compare data directly.

I implement an intro sort which compare primitive data directly for `sort_by`.
We can even afford an O(n) type check before primitive data sort.
It still go faster.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In most of case `sort_by` works on primitive type.
Using `qsort_r` with function pointer is much slower than compare data directly.

I implement an intro sort which compare primitive data directly for `sort_by`.
We can even afford an O(n) type check before primitive data sort.
It still go faster.</pre>
</div>
</content>
</entry>
</feed>
