Skip to content

Instantly share code, notes, and snippets.

@bollu
Created December 16, 2017 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bollu/7a9989a727ed4bf1c118dbcf386d4fc1 to your computer and use it in GitHub Desktop.
Save bollu/7a9989a727ed4bf1c118dbcf386d4fc1 to your computer and use it in GitHub Desktop.
Perf numbers

Clang -O3

  65533
 Performance counter stats for './a.out':

       5946.322757      task-clock (msec)         #    1.000 CPUs utilized          
                10      context-switches          #    0.002 K/sec                  
                 1      cpu-migrations            #    0.000 K/sec                  
               304      page-faults               #    0.051 K/sec                  
     8'892'727'488      cycles                    #    1.496 GHz                    
    27'206'198'331      instructions              #    3.06  insn per cycle         
     8'590'361'343      branches                  # 1444.651 M/sec                  
        12'736'166      branch-misses             #    0.15% of all branches        

       5.946830316 seconds time elapsed

GHC O3

➜  hs git:(master) ✗ sudo perf stat ./a.out 
[sudo] password for bollu: 
65533

 Performance counter stats for './a.out':

      29452.975010      task-clock (msec)         #    1.000 CPUs utilized          
                34      context-switches          #    0.001 K/sec                  
                 1      cpu-migrations            #    0.000 K/sec                  
             1'025      page-faults               #    0.035 K/sec                  
    44'068'693'204      cycles                    #    1.496 GHz                    
    89'471'140'922      instructions              #    2.03  insn per cycle         
    28'405'672'071      branches                  #  964.442 M/sec                  
         9'885'725      branch-misses             #    0.03% of all branches        

      29.452887691 seconds time elapsed

Custom haskell compiler (simplexhc) - using C like calling convention.

root@cantordust:/home/bollu/work/sxhc/simplexhc-cpp/bench# perf stat ./ackerman-worker-wrapper-optimised.stg.out
65533
 Performance counter stats for './ackerman-worker-wrapper-optimised.stg.out':

       8087.389206      task-clock (msec)         #    1.000 CPUs utilized          
                16      context-switches          #    0.002 K/sec                  
                 0      cpu-migrations            #    0.000 K/sec                  
               565      page-faults               #    0.070 K/sec                  
    12'096'559'028      cycles                    #    1.496 GHz                    
    32'934'184'669      instructions              #    2.72  insn per cycle         
     7'159'287'661      branches                  #  885.241 M/sec                  
        18'084'171      branch-misses             #    0.25% of all branches        

       8.087832647 seconds time elapsed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment