mirror of
https://github.com/uutils/coreutils
synced 2024-11-16 17:58:06 +00:00
e7da8058dc
To make this work we make default sort a special case of external sort. External sorting uses auxiliary files for intermediate chunks. However, when we can keep our intermediate chunks in memory, we don't write them to the file system at all. Only when we notice that we can't keep them in memory they are written to the disk. Additionally, we don't allocate buffers with the capacity of their maximum size anymore. Instead, they start with a capacity of 8kb and are grown only when needed. This makes sorting smaller files about as fast as it was before (I'm seeing a regression of ~3%), and allows us to seamlessly continue with auxiliary files when needed. |
||
---|---|---|
.. | ||
by-util | ||
common | ||
fixtures | ||
tests.rs |