![Lead Image © Lucy Baldwin, 123RF.com Lead Image © Lucy Baldwin, 123RF.com](/var/ezflow_site/storage/images/archive/2020/55/favorite-benchmarking-tools/123rf_9719495_martialarts_lucybaldwin_resized.png/170261-1-eng-US/123RF_9719495_MartialArts_LucyBaldwin_resized.png_medium.png)
Lead Image © Lucy Baldwin, 123RF.com
Favorite benchmarking tools
High Definition
At the Dragon Propulsion Laboratory, we are partial to using the simplest tool that will do the job at hand – particularly when dealing with the inherent complexity that performance measurement (and tuning) brings to the table. Yet that same complexity often requires advanced tooling to resolve the riddles posed by performance questions. I will examine my current benchmarking tool favorites from the simplest to the more sophisticated.
Tempus Fugit
The benchmark archetype is time
: simple, easy to use, and well understood by most users. In its purest form, time
takes a command as a parameter and times its execution in the real world (real), as well as how much CPU time was allocated in user and kernel (sys) modes:
$ time sleep 1 real 0m1.004s user 0m0.002s sys 0m0.001s
What not everyone knows is that the default time
command is actually one of the bash-builtins
[1]:
$ type time time is a shell keyword $ which time /usr/bin/time
There is time
, and then there is GNU time
[2]. The standalone binary version sports a few additional capabilities, the most noteworthy being its ability to measure page faults and swapping activity by the tested binary:
$ /usr/bin/time gcc test.c -o test 0.03user 0.01system 0:00.05elapsed 98%CPU (0avgtext+0avgdata 20564maxresident)k 0inputs+40outputs (0major+4475minor)pagefaults 0swaps
The sixth Dojo was dedicated to GNU time's amazing capabilities, and I invite you to read up in your prized archive of ADMIN back issues [3]. Table 1 sums up the capabilities of this versatile tool,
...Buy this article as PDF
(incl. VAT)