Skip to content

Instantly share code, notes, and snippets.

@thefallentree
Last active July 4, 2021 13:37
Show Gist options
  • Select an option

  • Save thefallentree/889e97fc0947cd84001a3a2fcd9efd88 to your computer and use it in GitHub Desktop.

Select an option

Save thefallentree/889e97fc0947cd84001a3a2fcd9efd88 to your computer and use it in GitHub Desktop.

Revisions

  1. thefallentree revised this gist Jul 4, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -37,6 +37,7 @@ string += (mm) : 33 ns
    string find/strsrch early : 4510 ns
    string find/strsrch late : 4298402 ns
    string find/strsrch miss : 5257616 ns
    string split/explode char : 3927884 ns
    string split/explode newline : 19138983 ns
    allocate array : 413 ns
    array creation (int) : 8 ns
    @@ -96,6 +97,7 @@ string += (mm) : 0 ns
    string find/strsrch early : 262 ns
    string find/strsrch late : 2386 ns
    string find/strsrch miss : 30202 ns
    string split/explode char : 583236 ns
    string split/explode newline : 138790 ns
    allocate array : 3155 ns
    array creation (int) : 77 ns
  2. thefallentree revised this gist Jul 4, 2021. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -34,7 +34,10 @@ string += (ss) : 40 ns
    string += (sm) : 41 ns
    string += (ms) : 40 ns
    string += (mm) : 33 ns
    string split/explode newline : 19006131 ns
    string find/strsrch early : 4510 ns
    string find/strsrch late : 4298402 ns
    string find/strsrch miss : 5257616 ns
    string split/explode newline : 19138983 ns
    allocate array : 413 ns
    array creation (int) : 8 ns
    array creation (string) : 8 ns
    @@ -90,7 +93,10 @@ string += (ss) : 0 ns
    string += (sm) : 0 ns
    string += (ms) : 0 ns
    string += (mm) : 0 ns
    string split/explode newline : 116251 ns
    string find/strsrch early : 262 ns
    string find/strsrch late : 2386 ns
    string find/strsrch miss : 30202 ns
    string split/explode newline : 138790 ns
    allocate array : 3155 ns
    array creation (int) : 77 ns
    array creation (string) : 86 ns
  3. thefallentree created this gist Jul 4, 2021.
    110 changes: 110 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,110 @@
    > speed
    fluffos v2019.20210429-13-g37c54583
    fib_recur(10) : 13290 ns
    fib_recur(20) : 1508421 ns
    fib(10) : 1104 ns
    fib(46) : 1973 ns
    fib(47) : 2308 ns
    fib(92) : 2240 ns
    instruction : 8 ns
    empty for : 835 ns
    while : 49610 ns
    while2 : 156572 ns
    if (x == 0) T : 7 ns
    if (x == 0) F : 8 ns
    if (x) T : 12 ns
    if (x) F : 9 ns
    if (x < n) T : 14 ns
    if (x < n) F : 10 ns
    if (!x) T : 10 ns
    if (!x) F : 10 ns
    if (x == n) T : 18 ns
    if (x == n) F : 8 ns
    if (x && y && z) F : 19 ns
    if (x && y && z) TF : 28 ns
    if (x && y && z) TTF : 46 ns
    if (x && y && z) TTT : 42 ns
    string assign (s) : 22 ns
    string assign (m) : 22 ns
    string add (ss) : 10 ns
    string add (sm) : 9 ns
    string add (ms) : 9 ns
    string add (mm) : 9 ns
    string += (ss) : 40 ns
    string += (sm) : 41 ns
    string += (ms) : 40 ns
    string += (mm) : 33 ns
    string split/explode newline : 19006131 ns
    allocate array : 413 ns
    array creation (int) : 8 ns
    array creation (string) : 8 ns
    array assign : 19 ns
    array addition : 8 ns
    array subtraction : 8 ns
    array lookup : 8 ns
    array += : 83 ns
    array -= : 153 ns
    allocate mapping : 190 ns
    mapping creation (int) : 8 ns
    mapping creation (string) : 8 ns
    mapping assign : 18 ns
    lookup string (exist) : 8 ns
    lookup string (missing) : 8 ns
    lookup int (exist) : 8 ns
    lookup int (missing) : 8 ns
    mapping insert : 31 ns
    mapping replace : 27 ns
    mapping delete : 22 ns
    local call (no args) : 29 ns
    local call (1 arg) : 35 ns
    local call (2 args) : 42 ns
    local call (3 args) : 49 ns
    simul_efun : 43 ns
    call_other : 323 ns
    call_other (string) : 418 ns
    call_other (miss) : 355 ns
    inherited call : 37 ns
    explicit inherited : 32 ns
    save_object : 446062 ns
    restore_object : 27045 ns

    fallentree-mbp:testsuite fallentree$ ./speed.py
    Python: sys.version_info(major=3, minor=7, micro=5, releaselevel='final', serial=0)
    fib_recur(10): : 23839 ns
    fib_recur(20): : 2801250 ns
    fib(10): : 2191 ns
    fib(46): : 4261 ns
    fib(47): : 5612 ns
    fib(92): : 6203 ns
    instruction: : 7 ns
    empty for: : 205881 ns
    while: : 521639 ns
    while2: : 532254 ns
    string assign (s) : 20 ns
    string assign (m) : 21 ns
    string add (ss) : 69 ns
    string add (sm) : 68 ns
    string add (ms) : 78 ns
    string add (mm) : 82 ns
    string += (ss) : 0 ns
    string += (sm) : 0 ns
    string += (ms) : 0 ns
    string += (mm) : 0 ns
    string split/explode newline : 116251 ns
    allocate array : 3155 ns
    array creation (int) : 77 ns
    array creation (string) : 86 ns
    array assign : 24 ns
    array addition : 88 ns
    array subtraction : 752 ns
    array lookup : 38 ns
    array += : 0 ns
    array -= : 0 ns
    allocate mapping : 3900 ns
    mapping creation (int) : 135 ns
    mapping creation (string) : 156 ns
    mapping assign : 20 ns
    lookup string (exist) : 36 ns
    lookup string (missing) : 79 ns
    lookup int (exist) : 37 ns
    lookup int (missing) : 74 ns