[TUHS] Bell Labs sed performance
John Cowan via TUHS
tuhs at tuhs.org
Tue Mar 24 04:43:26 AEST 2026
On Mon, Mar 23, 2026 at 5:05 AM Diomidis Spinellis via TUHS <tuhs at tuhs.org>
wrote:
Amazingly, in four benchmarks the Bell Labs implementation is
> still the fastest. At 1850 lines of code (including a regular
> expression engine) it's also the smallest one (FreeBSD, 2672 LoC; GNU
> 5462; Rust, 8946). Admittedly, modern sed versions have more features.
> Still, one can only admire the design and craftsmanship that went into
> the original implementation.
>
If you have time, you might want to benchmark the old GNU sed, which is
also Minix sed. The current version (1.16) lives at <
http://dl.exactcode.de/oss/minised/minised-1.15.tar.gz>. It's only
slightly longer than the Bell Labs sed at 1868 LoC.
More information about the TUHS
mailing list