HWZ Forums

Login Register FAQ Mark Forums Read

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

Reply
 
LinkBack Thread Tools
Old 14-08-2017, 09:38 AM   #1
Senior Member
 
Join Date: Jul 2009
Posts: 679
Benchmarking CPU, memory usage, I/O speed, running time

How do we benchmark a compiled binary executable in Linux/Unix?
u0206397 is offline   Reply With Quote
Old 14-08-2017, 02:32 PM   #2
Supremacy Member
 
davidktw's Avatar
 
Join Date: Apr 2010
Posts: 9,073
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.
davidktw is offline   Reply With Quote
Old 14-08-2017, 09:59 PM   #3
Senior Member
 
Join Date: Jul 2009
Posts: 679
OK. I found something like this: https://stackoverflow.com/questions/...on-linux-ubunt
u0206397 is offline   Reply With Quote
Old 14-08-2017, 10:19 PM   #4
Supremacy Member
 
davidktw's Avatar
 
Join Date: Apr 2010
Posts: 9,073
OK. I found something like this: https://stackoverflow.com/questions/...on-linux-ubunt
That is a start, but it wouldn't be sufficient. you need to learn how to interpret.
davidktw is offline   Reply With Quote
Old 15-08-2017, 09:57 AM   #5
Senior Member
 
Join Date: Jul 2009
Posts: 679
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.
u0206397 is offline   Reply With Quote
Old 15-08-2017, 10:21 AM   #6
Supremacy Member
 
davidktw's Avatar
 
Join Date: Apr 2010
Posts: 9,073
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.
davidktw is offline   Reply With Quote
Reply
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. Forum members and moderators are responsible for their own posts.

Please refer to our Terms of Service for more information.


Thread Tools

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On