Bystroushaak / tinySelf

Self-like language implemented in the RPython language toolkit.
29 stars 3 forks source link

Speedup effort: Rewrite TwoPointerArray to linked list #130

Closed Bystroushaak closed 5 years ago

Bystroushaak commented 5 years ago

Try benchmark and see whether it really is faster or not.

Bystroushaak commented 5 years ago

Result:

Dynamically created TwoPointerArray with preallocated size:

 Performance counter stats for './tSelf tests/scripts/count_to_1000000.self':

       3208,483098      task-clock (msec)         #    0,991 CPUs utilized
               266      context-switches          #    0,083 K/sec
                 0      cpu-migrations            #    0,000 K/sec
             2 132      page-faults               #    0,664 K/sec
    11 556 596 790      cycles                    #    3,602 GHz
    26 732 327 756      instructions              #    2,31  insn per cycle
     5 295 270 921      branches                  # 1650,397 M/sec
         7 821 002      branch-misses             #    0,15% of all branches

       3,238224427 seconds time elapsed

Dynamically created LinkedListForObjects:

 Performance counter stats for './tSelf tests/scripts/count_to_1000000.self':

       3528,093891      task-clock (msec)         #    0,995 CPUs utilized
                 8      context-switches          #    0,002 K/sec
                 0      cpu-migrations            #    0,000 K/sec
             2 338      page-faults               #    0,663 K/sec
    12 855 682 712      cycles                    #    3,644 GHz
    29 672 353 182      instructions              #    2,31  insn per cycle
     5 908 706 482      branches                  # 1674,759 M/sec
         7 157 622      branch-misses             #    0,12% of all branches

       3,546860470 seconds time elapsed