b668433256
Add cache for reflection lookup of CLI arguments. Replace CLI argument list with map. The current cli parser tries to match every possible command line argument against each command line argument, essentially in a double loop. This fix replaces one of the loops with a map lookup. Building the map is not expensive, and pays for itself even with a modest number of parameters. The map is cached between calls, making subsequent calls much cheaper. If run in a daemon, repeatedly parsing, e.g., 250 arguments, this speeds up argument parsing by a factor 20. Disallow -shortName=value in CLI arguments. Co-authored-by: Troels Lund <troels@google.com>