diff options
author | Pádraig Brady <P@draigBrady.com> | 2011-05-13 18:41:42 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2011-05-14 10:30:12 +0100 |
commit | 27873f1deb69745c79d403bbb8e1145bc18f55b8 (patch) | |
tree | d3b752eed0035e9ce767ea73c07f3b8577deaead /NEWS | |
parent | 9d152a1ed72968ae3624a76e155fe16b240348dc (diff) | |
download | coreutils-27873f1deb69745c79d403bbb8e1145bc18f55b8.tar.xz |
shuf: use memory more efficiently when returning a subset
* gl/lib/randperm.c (randperm_new): When the number of items
to return H, is much smaller than the total number of items N,
use a hash to represent the sparse permutations of the set N.
This is currently enabled for N > 128K and N/H > 32.
* tests/misc/shuf: Ensure shuf can quickly return 2 numbers
from a large range.
* gl/modules/randperm: Depend on hash.
* NEWS: Mention the change.
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -12,6 +12,11 @@ GNU coreutils NEWS -*- outline -*- Note the use of single quotes, not double quotes. That creates files named xaa.xz, xab.xz and xac.xz. +** Improvements + + shuf outputs small subsets of large permutations much more efficiently. + For example `shuf -i1-$((2**32-1)) -n2` no longer exhausts memory. + * Noteworthy changes in release 8.12 (2011-04-26) [stable] |