<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs, branch scratch/sort-key</title>
<subtitle>Emacs is the extensible, customizable, self-documenting real-time display editor. 
</subtitle>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/'/>
<entry>
<title>Remove sort-on</title>
<updated>2024-03-23T13:18:57+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2024-03-22T14:06:27+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=ed59a2639a9dd4927d0424f292b1ba30f65bb8bb'/>
<id>ed59a2639a9dd4927d0424f292b1ba30f65bb8bb</id>
<content type='text'>
* lisp/sort.el (sort-on):
* doc/lispref/sequences.texi (Sequence Functions):
* etc/NEWS:
Remove the `sort-on` function which is now completely superseded by
the extended `sort` in features, ease of use, and performance.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* lisp/sort.el (sort-on):
* doc/lispref/sequences.texi (Sequence Functions):
* etc/NEWS:
Remove the `sort-on` function which is now completely superseded by
the extended `sort` in features, ease of use, and performance.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use new-style sort signature in Lisp manual examples</title>
<updated>2024-03-23T13:18:57+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2024-03-22T14:08:50+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=592ca5070e209dc293ad3be2348dfef801bf0ed1'/>
<id>592ca5070e209dc293ad3be2348dfef801bf0ed1</id>
<content type='text'>
* doc/lispref/help.texi (Accessing Documentation):
* doc/lispref/strings.texi (Text Comparison):
Use the new sort calling convention (bug#69709).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* doc/lispref/help.texi (Accessing Documentation):
* doc/lispref/strings.texi (Text Comparison):
Use the new sort calling convention (bug#69709).
</pre>
</div>
</content>
</entry>
<entry>
<title>Update manual entry for `sort` (bug#69709)</title>
<updated>2024-03-23T13:18:57+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2024-03-22T14:02:45+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=4de459373135bbaecb932d87dd919760bdfd4fa7'/>
<id>4de459373135bbaecb932d87dd919760bdfd4fa7</id>
<content type='text'>
* doc/lispref/sequences.texi (Sequence Functions):
Update the manual about the new `sort` arguments.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* doc/lispref/sequences.texi (Sequence Functions):
Update the manual about the new `sort` arguments.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add NEWS entry for new `sort` arguments and features</title>
<updated>2024-03-23T13:18:57+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2024-03-19T17:24:15+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=7250e610f5142c7f7e47547de46038b896eabbda'/>
<id>7250e610f5142c7f7e47547de46038b896eabbda</id>
<content type='text'>
* etc/NEWS: Announce the changes (bug#69709).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* etc/NEWS: Announce the changes (bug#69709).
</pre>
</div>
</content>
</entry>
<entry>
<title>Faster non-destructive list sorting</title>
<updated>2024-03-23T13:18:57+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2024-03-22T10:54:09+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=5fe92f3c33aa01dc871012b7e2b2b494780d94d4'/>
<id>5fe92f3c33aa01dc871012b7e2b2b494780d94d4</id>
<content type='text'>
Postpone the creation of a new list to after sorting which turns out to
be a lot faster (1.1x - 1.5x speedup).

* src/fns.c (sort_list, sort_vector, Fsort):
Create the new list when moving the data out from the temporary array.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Postpone the creation of a new list to after sorting which turns out to
be a lot faster (1.1x - 1.5x speedup).

* src/fns.c (sort_list, sort_vector, Fsort):
Create the new list when moving the data out from the temporary array.
</pre>
</div>
</content>
</entry>
<entry>
<title>Speed up `sort` by special-casing the value&lt; ordering</title>
<updated>2024-03-23T13:18:57+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2024-03-21T18:35:15+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=24bfd3e89d38df14599d070d208087cfcb244030'/>
<id>24bfd3e89d38df14599d070d208087cfcb244030</id>
<content type='text'>
This gives a 1.5x-2x speed-up when using the default :lessp value,
by eliminating the Ffuncall overhead.

* src/sort.c (order_pred_lisp, order_pred_valuelt): New.
(merge_state, inorder, binarysort, count_run, gallop_left, gallop_right)
(merge_init, merge_lo, merge_hi, tim_sort):
* src/fns.c (Fsort):
When using value&lt;, call it directly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This gives a 1.5x-2x speed-up when using the default :lessp value,
by eliminating the Ffuncall overhead.

* src/sort.c (order_pred_lisp, order_pred_valuelt): New.
(merge_state, inorder, binarysort, count_run, gallop_left, gallop_right)
(merge_init, merge_lo, merge_hi, tim_sort):
* src/fns.c (Fsort):
When using value&lt;, call it directly.
</pre>
</div>
</content>
</entry>
<entry>
<title>New `sort` keyword arguments (bug#69709)</title>
<updated>2024-03-23T13:18:56+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2024-03-19T12:03:47+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=2cef2a91c13d9bdc3129605cbb4dc91261867de4'/>
<id>2cef2a91c13d9bdc3129605cbb4dc91261867de4</id>
<content type='text'>
Add the :key, :lessp, :reverse and :in-place keyword arguments.
The old calling style remains available and is unchanged.

* src/fns.c (sort_list, sort_vector, Fsort):
* src/sort.c (tim_sort):
Add keyword arguments with associated new features.
All callers of Fsort adapted.
* test/src/fns-tests.el (fns-tests--shuffle-vector, fns-tests-sort-kw):
New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add the :key, :lessp, :reverse and :in-place keyword arguments.
The old calling style remains available and is unchanged.

* src/fns.c (sort_list, sort_vector, Fsort):
* src/sort.c (tim_sort):
Add keyword arguments with associated new features.
All callers of Fsort adapted.
* test/src/fns-tests.el (fns-tests--shuffle-vector, fns-tests-sort-kw):
New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add back timsort key function handling (bug#69709)</title>
<updated>2024-03-23T08:52:45+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2024-03-18T18:56:20+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=01e5337293cf0da834a0e44f33330f8bfe78d945'/>
<id>01e5337293cf0da834a0e44f33330f8bfe78d945</id>
<content type='text'>
The original timsort code did provide for a key (accessor) function
along with the necessary storage management, but we dropped it because
our `sort` function didn't need it.

Now it's been put back since it seems that it will come in handy after all.

* src/fns.c (sort_list, sort_vector, Fsort): Pass Qnil as key function
to tim_sort.
* src/sort.c (reverse_slice, sortslice_copy)
(sortslice_copy_incr, sortslice_copy_decr, sortslice_memcpy)
(sortslice_memmove, sortslice_advance): New functions.
(sortslice): New type.
(struct stretch, struct reloc, merge_state)
(binarysort, merge_init, merge_markmem, cleanup_mem)
(merge_register_cleanup, merge_getmem, merge_lo, merge_hi, merge_at)
(found_new_run, reverse_sortslice, resolve_fun, tim_sort):
Merge back previously discarded parts from the upstreams timsort code
that dealt with key functions, and adapt them to fit in.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The original timsort code did provide for a key (accessor) function
along with the necessary storage management, but we dropped it because
our `sort` function didn't need it.

Now it's been put back since it seems that it will come in handy after all.

* src/fns.c (sort_list, sort_vector, Fsort): Pass Qnil as key function
to tim_sort.
* src/sort.c (reverse_slice, sortslice_copy)
(sortslice_copy_incr, sortslice_copy_decr, sortslice_memcpy)
(sortslice_memmove, sortslice_advance): New functions.
(sortslice): New type.
(struct stretch, struct reloc, merge_state)
(binarysort, merge_init, merge_markmem, cleanup_mem)
(merge_register_cleanup, merge_getmem, merge_lo, merge_hi, merge_at)
(found_new_run, reverse_sortslice, resolve_fun, tim_sort):
Merge back previously discarded parts from the upstreams timsort code
that dealt with key functions, and adapt them to fit in.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add manual entry for value&lt; (bug#69709)</title>
<updated>2024-03-23T08:52:39+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2024-03-22T13:23:14+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=3a3568784eab9eb7889d23e40f498f3cf89beea0'/>
<id>3a3568784eab9eb7889d23e40f498f3cf89beea0</id>
<content type='text'>
* doc/lispref/sequences.texi (Sequence Functions):
* doc/lispref/numbers.texi (Comparison of Numbers):
* doc/lispref/strings.texi (Text Comparison):
Document the new value&lt; function.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* doc/lispref/sequences.texi (Sequence Functions):
* doc/lispref/numbers.texi (Comparison of Numbers):
* doc/lispref/strings.texi (Text Comparison):
Document the new value&lt; function.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add NEWS entry for value&lt; (bug#69709)</title>
<updated>2024-03-23T08:52:01+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2024-03-19T17:39:07+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=2dc07013ef2c8dad20f81056d56c586472b94441'/>
<id>2dc07013ef2c8dad20f81056d56c586472b94441</id>
<content type='text'>
* etc/NEWS: Announce.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* etc/NEWS: Announce.
</pre>
</div>
</content>
</entry>
</feed>
