[TUHS] Perkin-Elmer Sort/Merge II vs Unix sort(1)

Larry McVoy lm at mcvoy.com
Sun Jan 19 01:16:56 AEST 2025


On Sat, Jan 18, 2025 at 04:51:15PM +0200, Diomidis Spinellis wrote:
> I'm sure the mainframe sort programs did some pretty amazing things and
> could run circles around the puny 830 line Unix Seventh Edition sort
> program.  The 215 page IBM DOS VS sort documentation that John Levine posted
> here is particularly impressive.  But I can't stop thinking that, in common
> with the mainframes these programs were running on, they represent a mindset
> that has been surpassed by superior ideas.

I disagree.  Go back and read the reply where someone was talking about
sorting datasets that spanned multiple tapes, each of which was much
larger than local disk.  sort(1) can't begin to think about handling
something like that.

I have a lot of respect for how Unix does things, if the problem fits
then the Unix answer is more simple, more flexible, it's better.  If
the problem doesn't fit, the Unix answer is awful.

cmd < data | cmd2 | cmd3

is a LOT of data copying.  A custom answer that did all of that in
one address space is a lot more efficient but also a lot more special
purpose.  Unix wins on flexibility and simplicity, special purpose
wins on performance.


More information about the TUHS mailing list