September 2017
Intermediate to advanced
466 pages
9h 33m
English
In this section, we will compare the performance of wc.go from Chapter 6, File Input and Output, with the performance of wc(1), dWC.go and dWCtotal.go. In order for the results to be more accurate, all three utilities will process relatively big files:
$ wc /tmp/*.data 712804 3564024 9979897 /tmp/connections.data 285316 855948 4400685 /tmp/diskSpace.data 712523 1425046 8916670 /tmp/memory.data 1425500 2851000 5702000 /tmp/pageFaults.data 285658 840622 4313833 /tmp/uptime.data 3421801 9536640 33313085 total
So, the time(1) utility will measure the following commands:
$ time wc /tmp/*.data /tmp/*.data $ time wc /tmp/uptime.data /tmp/pageFaults.data $ time ./dWC /tmp/*.data /tmp/*.data $ time ./dWC /tmp/uptime.data /tmp/pageFaults.data ...
Read now
Unlock full access