Executing Shell Scripts in the Wrong Order, Correctly

Presenter: Georgios Liargkovas
Date: 08 May 2023


Shell scripts are critical infrastructure, for developers, administrators, and scientists, and therefore deserve the full suite of advances in compiler optimizations. We propose executing scripts out-of-order to better utilize the underlying computational resources. Optimizing any part of an arbitrary shell script is very challenging: the shell language’s complex, late-bound semantics makes extensive use of opaque external commands. We address these challenges by meeting dynamism with dynamism: we optimize at runtime, speculatively executing commands in an isolated and monitored environment to determine and contain their behavior. Our proposed approach can yield serious performance benefits (up to 3.9× for a bioinformatics script on a 16-core machine) for arbitrarily complex scripts without modifying their behavior. Contained out-of-order execution obviates the need for command specifications, operates on external commands, and yields a much more general framework for the improving the shell.