Subject: bug#19896: 23.1; reverse-region is slow compared to sort-columns

From: Ivan Shmakov <[email-masked]>
Date: Wed, 18 Feb 2015 18:29:08 +0000

>>>>> asparagus  <[email-masked]> writes:

 > The emacs manual recommends 'M-x reverse-region' as a companion to
 > 'M-x sort-columns' to achieve a descending-order column sort.

	This could be a bug in the manual, as sort-columns has an
	optional (prefix) ‘reverse’ argument since at least 1990
	(d32200ac.)

 > However, for large regions (> 100k lines), 'M-x reverse-region' is
 > noticeably slower than 'M-x sort-columns', making descending sort
 > much slower than ascending sort.

	I don’t seem to see this on the current master; at a glance,
	M-x reverse-region takes less time to complete than
	M-x sort-columns.

	The current stable version of Emacs is 24.4, with the pretest
	for 24.5 being available since 17th [1].  Could you please check
	if this issue also manifests with either of these versions?

	TIA.

[1] news:[email-masked]
    http://permalink.gmane.org/gmane.emacs.devel/183187

 > A workaround on linux: use 'C-u M-x shell-command-on-region' with tac
 > (the opposite of cat) instead of using 'M-x reverse-region'.

	On a GNU system (as well as on any other system featuring
	GNU Coreutils), it should be possible to just use sort(1) for
	the purpose.  For instance, the “reverse” option is ‘-r’.

[…]

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A