Optionally Use Faster Programs Like ripgrep?
I can look for other potential replacements, but I was wondering if you'd be open to considering optionally using tools like ripgrep instead of grep? I see you already look for mawk if it's there.
Grep was only used for the check command to determine whether the (non-standard) options --buffer-size or --parallel are available. The biggest performance impact of the check is starting the sort and grep processes, connecting the pipes, passing and reading the output of sort --help. I would not worry too much about this overhead, as it is in the range of ms, and only executed once per script. In the ideal case the check would be implemented with builtin bash functions.
Grep was only used for the check command to determine whether the (non-standard) options --buffer-size or --parallel are available.
Apologies for the bad example.
One potential optimization would be to change --parallel=2 to something like --parallel=$(nproc), or is nproc not sufficiently POSIX or whatnot?
https://github.com/thomasrebele/bashlog/blob/92065192ee44655ffdd4ecdc662311d33fc9e091/src/main/java/bashlog/BashlogCompiler.java#L123