Performance testing
For the benchmark, I will be using the GNU implementation of the time
utility, with the –v
option for verbose output. For the input data, I'll be using the invItems.yaml
file, which can be found in this chapter's folder on GitHub. The input data does not really matter as long as it is YAML, but I chose this data because it was fairly large, coming in at 53.2 MB. To perform the benchmark, we will follow these steps:
- Start with the old version of the code, so be sure to revert to the old code before continuing.
- Build the binary in release mode via
shards build --release
. Since we want to test the performance of our application and not jq, we are just going to use the identity filter so as to not give jq extra work. - Run the benchmark via
/usr/bin/time -v ./bin/transform . invItems.yaml > /dev/null
. Given we do not care about the actual output, we are just redirecting the output to/dev/null
. This command will output quite a bit of...