language agnostic - Which metric should be used for benchmarks? -


When I benchmark some code, either on a fixed set of input data or on the random input, the control flow Affects: What is the best metric to use to evaluate the performance of my code?

I have always used many runs on minimum runs because any deviation from the minimum would be due to the CPU being busy in unrelated things, but I could not find a reliable source that confirms that This is the best practice. Other obvious options are average or average run time (seems to be odd, because it is dominated by unrelated CPU spikes.) Are there any better ways to understand the statistical data gathered from multiple runs?

As Paksidipolo says, if I can measure CPU time directly that would be ideal. But when I can only make time for the benchmark wall, what do I have to do?

As I said that I did not find anything reliable on this, but maybe I did not get the right Google keywords, so if you can point me to something current, that's already a big Also, please feel free to transfer this program to programmers. ESE, if this question is very common for SO.

If you are performing CPU time benchmarking, then some systems have passed you, or wall, time Will provide independent CPU usage from.

You are right that depending on the timing of the wall depending on the system, it usually does not affect the CPU time.

For example, the time utility in Linux (and operating systems like other Unix) reports as follows:

  Pax & gt; Time sleep 1 real 0 M 1.001 user 0 m 0 ssm 0 cc  

is the time of the real time wall, using a touch CPU on each other < Code> Users and sys are spent, which is less in this case because this process is awaiting the end of sleep (no action which is practically no CPU

If you have this feature available, then use it

If you have a feature like not you probably have to use statistical methods, such as reducing CPU usage from other processes and creating a decent picture For you to run your process multiple times.

Whether you depend on the basis of the average schools that you follow, like average or minimum (or the average after removing some weird outletors) If you say that If you do not have any changes due to workload, you should choose the minimum.

And make sure that other loads are less important if you have a CPU bell If there is 97% of the part, then at least one will be less compared to the useless system (this is why the CPU time is better than the time of the wall).


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -