Benchmarking CPU, memory usage, I/O speed, running time

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
How do we benchmark a compiled binary executable in Linux/Unix?

This will be too generic a question. The way to benchmark a piece of software is to first understand how the software works and what kind of resources it consumes when under load.
You will need to establish a hypothesis on what are the likely bottlenecks and uses tools to view and measure it.

In *nix, we have tools like sysstats, iostats, vmstats, dstats, netstats, top, ps, iftop, iotop, time, to help view the condition of the system and observe processes behaviours. If you are on Java, you can further drill using JMX tools.

If you are running in AWS, you can further use cloudwatch to see beyond a single host behaviour.
 

u0206397

Senior Member
Joined
Jul 15, 2009
Messages
764
Reaction score
0
Yeah. I can't quite recall how they do it. I saw some reviews comparing implementations of codes in different programming languages, or using different compilers and they measured the CPU, memory usage and running time to see which one is faster or more efficient.

But now cannot recall what tools or commands the reviewers used.
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
Yeah. I can't quite recall how they do it. I saw some reviews comparing implementations of codes in different programming languages, or using different compilers and they measured the CPU, memory usage and running time to see which one is faster or more efficient.

But now cannot recall what tools or commands the reviewers used.

There is no hard and fast rule to performance benchmarking. Low CPU doesn't mean the code is inefficient. It could be due to waiting for external resources commonly classified under I/O (network/storage) or even synchronisation on locks

Memory usage is also not a good gauge for performance. Just because one application uses 10MB doesn't mean it is performing poorly.

Running time alone is insufficient. You have to measure against load to know if the timing is meant to be long or short.

Performance benchmarking with the intention to tune is an Art. You don't just plainly look at numbers and scale them based on less or more. You have to know what you are looking for and trying to measure, then you interpret the numbers to see if it fits your hypothesis.
 
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ Forums. Forum members and moderators are responsible for their own posts. Please refer to our Community Guidelines and Standards and Terms and Conditions for more information.
Top