ash ${str/find/repl} performance

Alin Mr almr.oss at
Wed Jul 21 21:14:38 UTC 2021


> busybox is about size, not speed.

Yes, I know busybox from embedded work. Surprisingly, switching to busybox in a "normal" Linux app (Kakoune -- a modal editor that uses POSIX shell as an extension language) made the program a lot faster. Like, twice faster for startup:

  'KKPSH=bboxsh/builtin+nofork/sh kakrun' ran
    1.07 ± 0.02 times faster than 'KKPSH=bboxsh/builtin/sh kakrun'
    1.21 ± 0.01 times faster than 'KKPSH=bboxsh/links/sh PATH="bboxsh/links:$PATH" kakrun'
    1.40 ± 0.01 times faster than 'KKPSH=bboxsh/builtin+dynld/sh kakrun'
    2.08 ± 0.03 times faster than 'KKPSH=bboxsh/links/sh kakrun'
    2.09 ± 0.01 times faster than 'dash kakrun'

(bboxsh/links/sh is an Alpine 1.33 static version without builtin coreutils; all the others are 1_33_stable, STATIC + FEATURE_SH_STANDALONE + FEATURE_PREFER_APPLETS).

So busybox can also be about speed. Of course, this is well known, since ash has been much faster than bash for a long time, even without builtin applets (which is why distros switched to it at some point).

More information about the busybox mailing list