Peter is a DZone MVB and is not an employee of DZone and has posted 154 posts at DZone. You can read more from them at their website. View Full User Profile

Benchmarking on the Slowest Machine You Can Find

  • submit to reddit

When performing benchmarks I usually reach for the fastest machine I can. The theory is that if speed matters you will use a fast machine.

Recently I have tried benchmarking the slowest machine I have access to. A Pentium IV dual core laptop with 4 GB of memory and a regular HDD. The assumption is that if this performs better than your need, it might not matter how fast your system is. In the article, I am comparing this laptop to a fast machine. The point is, if the slow machine is more than enough you don't need to worry about hardware.

Latency test

The round trip average latencies tests were 10 times slower and there were over 1000x more delayed messages. Even so, a delay of an average of 4 micro-seconds is faster than many applications need.
The average RTT latency was 3,442 ns. The 50/99 / 99.9/99.99%tile latencies 
    were 1,790/1,790 / 103,550/2,147,483,647. 
    There were 39,891 delays over 100 μs

Throughput test

The biggest difference I saw in the throughput test was that when the machine ran out memory, performance of the whole machine dropped dramatically. (Even the Task Manager stopped working) This is not too surprising as the performance becomes dependant on the speed of the HDD. The HDD in a budget laptop is slow even compared to that in a desktop. Compared with a fast SSD, it is not surprising that its much slower. When testing the throughput performance for a dataset of 2.6 GB (the machine has 4 GB total) the performance is good, about four times slower.
Took 10.454 seconds to write/read 60,000,000 entries, rate was 5.7 M entries/sec
Increase the dataset size to 5.2 GB and the performance drops to around 200 K entries/second.
Took 974.180 seconds to write/read 200,000,000 entries, rate was 0.2 M entries/sec

Logging test

This logs short lines of text with the date, thread name a string and a double value.
To log 1,000,000 messages took 0.631 seconds using Chronicle and 12.259 seconds using Logger
This is around three times slower than the fast machine.



Published at DZone with permission of Peter Lawrey, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)



Liam Knox replied on Sun, 2012/03/04 - 3:03pm

surely you are looking at chalk and cheese. you tune for what you know. not for what you do not

Peter Lawrey replied on Fri, 2012/12/21 - 4:38pm in response to: Liam Knox

You tune for your target system, but when you want to stress test your code, it is a good idea to also test a different system, preferably a slower one with less resources as these are easier to load up and might show race conditions which rarely appear on the higher spec machine.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.