Benchmarking two binary file in linux

I have two binary file.This file is not make by me.

I need to benchmarking this files to see how works fast and well.

I try to use the time command but the big problem is :

  1. to run in same time the files
  2. to stop in same time the running files
  3. to use time command with this two files.

If i use this solution Benchmarking programs on Linux and change the place of the file with time running command the output changed.

0m0.010s file1 
0m0.017s file2

change the order in time command .

0m0.002s file2
0m0.013s file1 

Thank you. Regards.

Upvotes: 0

Views: 493

Answers (1)

mvp
mvp

Reputation: 116207

There are many ways to do what you want, but probably simplest one is to simply run one program in a loop many times (say 1000 or more) such that total execution time becomes something that is easy to measure - say, 50 seconds. Then repeat the same for another one.

This allows you to get much more accurate measurements, and also minimizes inherent jitter between runs.

Having said that, note that with run times as low as you observe, time to start process may be not a small fraction of total measurement you get. So, if you run a loop, be sure to consider price to start new process 1000 times.

Upvotes: 1

Related Questions