Bystroushaak / tinySelf

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

Speedup effort: Try sharing TwoPointerArray / linked list instances between calls #131

Closed Bystroushaak closed 5 years ago

Bystroushaak commented 5 years ago

My approach today is to create the instance with each new call of the method. Try sharing it and just emptying it.

Will require: creation of .clean() or .reset() method.

Bystroushaak commented 5 years ago
TwoPointerArray created with each call:

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

       3374,631146      task-clock (msec)         #    0,991 CPUs utilized
               281      context-switches          #    0,083 K/sec
                 0      cpu-migrations            #    0,000 K/sec
             2 173      page-faults               #    0,644 K/sec
    11 793 176 090      cycles                    #    3,495 GHz
    26 770 314 042      instructions              #    2,27  insn per cycle
     5 301 492 901      branches                  # 1570,984 M/sec
         7 585 934      branch-misses             #    0,14% of all branches

       3,406320716 seconds time elapsed

With shared TwoPointerArray:

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

       3149,518400      task-clock (msec)         #    0,994 CPUs utilized
                 9      context-switches          #    0,003 K/sec
                 0      cpu-migrations            #    0,000 K/sec
             2 006      page-faults               #    0,637 K/sec
    10 949 900 557      cycles                    #    3,477 GHz
    25 629 031 511      instructions              #    2,34  insn per cycle
     5 101 121 607      branches                  # 1619,651 M/sec
         5 487 267      branch-misses             #    0,11% of all branches

       3,170100371 seconds time elapsed