Skip to content

💡 Performance differences in pdksh-derived shells

Notifications You must be signed in to change notification settings

Neved4/pdksh-perf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pdksh-perf - printf performance in oksh, mksh, posh

Some performance differences in pdksh-derived shells.

Getting Started

To benchmark these, install hyperfine, then run:

for i in mksh oksh
do
    hyperfine -w32 -r64 -S none --sort mean-time -L shell $i \
      '{shell} ./bg_for.ksh' '{shell} ./bg_printf.ksh' '{shell} ./bg_while.ksh'
done

Output

Summary
  mksh ./bg_for.ksh ran
    1.04 ± 0.08 times faster than mksh ./bg_while.ksh
    4.04 ± 0.25 times faster than mksh ./bg_printf.ksh

  oksh ./bg_for.ksh ran
    1.01 ± 0.07 times faster than oksh ./bg_while.ksh
    2.20 ± 0.14 times faster than oksh ./bg_printf.ksh

These benchmarks can be reproduced in oksh 7.3 and mksh 59c. The posh 0.14.1 shell lacks a built-in print. All of them come originally from pdksh.

Without using the print built-in, execution slows down by a factor of 3X. With a more detailed table, execution drops significantly to 110X times slower. These disparities disappeared once the print function was introduced.

About

💡 Performance differences in pdksh-derived shells

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages