Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make bitops inlinable
  • Loading branch information
sorear committed May 30, 2011
1 parent 2825023 commit c49e30c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 0 additions & 4 deletions perf/perf.TODO
Expand Up @@ -7,14 +7,10 @@ Experiment with "if non-overriden, then replace method" hooks

Experiment with making P6any: Variable

push, shift, etc off-loop?

Avoid calling a function for trivial attribute (or parameter) defaults

Improve isa, somehow.

Subquadratic nibbling. Also improve nibbler's use of GetKey and push.

Reduce redundant Cursor creation for, e.g., { say 2 }
Reduce ContextHelper use in ws, or make it faster.

Expand Down
12 changes: 6 additions & 6 deletions perf/std-20110528.pl6
Expand Up @@ -20,9 +20,9 @@ sub bench($name, $nr, $f) {

my @arr;

bench "(zeroing array)", 100000, sub () { @arr = () };
bench "(tenning array)", 100000, sub () { @arr = 0,1,2,3,4,5,6,7,8,9 };
bench "push", 100000, sub () { @arr = (); push @arr, 1; push @arr, 2; push @arr, 3; push @arr, 4; push @arr, 5; push @arr, 6; push @arr, 7; push @arr, 8; push @arr, 9; push @arr, 10; };
bench "unshift", 100000, sub () { @arr = (); unshift @arr, 1; unshift @arr, 2; unshift @arr, 3; unshift @arr, 4; unshift @arr, 5; unshift @arr, 6; unshift @arr, 7; unshift @arr, 8; unshift @arr, 9; unshift @arr, 10; };
bench "pop", 100000, sub () { @arr = 0,1,2,3,4,5,6,7,8,9; pop @arr; pop @arr; pop @arr; pop @arr; pop @arr; pop @arr; pop @arr; pop @arr; pop @arr; pop @arr };
bench "shift", 100000, sub () { @arr = 0,1,2,3,4,5,6,7,8,9; shift @arr; shift @arr; shift @arr; shift @arr; shift @arr; shift @arr; shift @arr; shift @arr; shift @arr; shift @arr };
bench "or", 10000000, sub () { 1 +| 2 };
bench "xor", 10000000, sub () { 1 +^ 2 };
bench "and", 10000000, sub () { 1 +& 2 };
bench "lshift", 10000000, sub () { 1 +> 2 };
bench "rshift", 10000000, sub () { 1 +< 2 };
bench "compl", 10000000, sub () { +^ 1 };
6 changes: 6 additions & 0 deletions src/NieczaPassSimplifier.pm6
Expand Up @@ -79,6 +79,12 @@ our %funcs = (
'&infix:<<>' => do_builtin('numlt', 2),
'&infix:<!=>' => do_builtin('numne', 2),
'&infix:<+>' => do_builtin('plus', 2),
'&infix:<+&>' => do_builtin('numand', 2),
'&infix:<+|>' => do_builtin('numor', 2),
'&infix:<+^>' => do_builtin('numxor', 2),
'&infix:<+<>' => do_builtin('numlshift', 2),
'&infix:<+>>' => do_builtin('numrshift', 2),
'&prefix:<+^>' => do_builtin('numcompl', 1),
'&last' => do_nullary_control(2),
'&make' => do_builtin('make', 1),
'&map' => &do_map_grep,
Expand Down

0 comments on commit c49e30c

Please sign in to comment.