While testing expr for performance, I noticed a 10x factor between our implementation and GNU's implementation when giving the command a large list of arguments (1 + 1 + 1 ... 10000 times).
The profiling indicates that the bottleneck is caused by clap which takes forever to parse all the arguments.
This is actually not needed, because expr can only be used in 3 possible ways :
expr --version
expr --help
expr [TOKENS ...]
This is simple enough so we shouldn't need clap to do it for us.
While testing
exprfor performance, I noticed a 10x factor between our implementation and GNU's implementation when giving the command a large list of arguments (1 + 1 + 1 ... 10000 times).The profiling indicates that the bottleneck is caused by clap which takes forever to parse all the arguments.
This is actually not needed, because
exprcan only be used in 3 possible ways :expr --versionexpr --helpexpr [TOKENS ...]This is simple enough so we shouldn't need clap to do it for us.