Skip to contentSkip to conversation

perf: comparing "CPU performance / CPU impact" of two binaries?

DISCUSSION Tomasz Chmielewski 1 participant 1 message Dec 19, 2016

lore
Share & tools
lore
#0 lore raw

Let's say I have two binaries which convert complex data from one format to another.

I will run them on a busy server at low priority and I don't really care if one is faster than the other - I want to know which of them will have lower "CPU impact" to perform the same task.

binary_1:

26879408.172126 task-clock:u (msec) # 0.709 CPUs
utilized

                 0      context-switches:u        #    0.000 K/sec
                 0      cpu-migrations:u          #    0.000 K/sec
        1142192473      page-faults:u             #    0.042 M/sec
    81241884199345      cycles:u                  #    3.022 GHz         
             (83.59%)
    65593453047217      stalled-cycles-frontend:u #   80.74% frontend 
cycles idle     (83.59%)
    34800591044061      stalled-cycles-backend:u  #   42.84% backend 
cycles idle      (67.09%)
    98783244945290      instructions:u            #    1.22  insn per 
cycle
                                                  #    0.66  stalled 
cycles per insn  (83.64%)
    18250463170335      branches:u                #  678.976 M/sec       
             (83.60%)
      169450790563      branch-misses:u           #    0.93% of all 

branches (83.59%)

37911.679793230 seconds time elapsed

binary_2:

33134123.016486 task-clock:u (msec) # 1.071 CPUs
utilized

                 0      context-switches:u        #    0.000 K/sec
                 0      cpu-migrations:u          #    0.000 K/sec
        1947142971      page-faults:u             #    0.059 M/sec
   105227191042973      cycles:u                  #    3.176 GHz         
             (83.69%)
    80721331715962      stalled-cycles-frontend:u #   76.71% frontend 
cycles idle     (83.69%)
    46245245856602      stalled-cycles-backend:u  #   43.95% backend 
cycles idle      (67.25%)
   140459525725760      instructions:u            #    1.33  insn per 
cycle
                                                  #    0.57  stalled 
cycles per insn  (83.93%)
     9187630340020      branches:u                #  277.286 M/sec       
             (83.70%)
      112107883833      branch-misses:u           #    1.22% of all 

branches (83.69%)

30949.033426941 seconds time elapsed

As you can see, binary_1 was executing for 37911 seconds, and binary_2 for 30949 seconds.

On the other hand, binary_2 used more cycles and instructions.

Because I will be running it on a busy server, I think that binary_1 will have lower impact on the CPU (and, other tasks). Is my reasoning correct?

Tomasz Chmielewski
https://lxadm.com