Permalink
Browse files

Improve inlining for , and =>

  • Loading branch information...
1 parent 94d8f55 commit cc6a5c3d0fc89006cc60dc5c569e21e68313aa2d @sorear committed May 28, 2011
Showing with 57 additions and 34 deletions.
  1. +8 −0 perf/perf.TODO
  2. +37 −34 perf/std-20110528.pl6
  3. +12 −0 src/niecza
View
@@ -6,3 +6,11 @@ Experiment with techniques to avoid Variable[] allocation on all calls
Experiment with "if non-overriden, then replace method" hooks
Experiment with making P6any: Variable
+
+Improve , & => inlining, do away with RAWCREATE
+
+$<foo> should make a postcircumfix call
+
+Make LISTSTORE off-loop?
+
+push, shift, etc off-loop?
View
@@ -25,38 +25,41 @@ bench "nulling test", 1000000, sub () {};
bench "iterate empty list", 1000000, sub () { for @l { } };
}
-my $str = "0";
-$str ~= $str for ^18;
-say $str.chars;
-# $str = substr($str,0,1000000);
+my ($x, $y);
+bench "Parcel.LISTSTORE", 1000000, sub () { ($x,$y) = ($y,$x) };
-my grammar GTest {
- token TOP { <.bit>* }
- token bit { . }
-}
-
-bench "grammar", 1, sub () { GTest.parse($str) };
-{
- my class GAct0 {
- }
- bench "grammar (no action)", 1, sub () { GTest.parse($str, :actions(GAct0)) };
-}
-
-{
- my class GAct1 {
- method bit($ ) { }
- }
- bench "grammar (empty action)", 1, sub () { GTest.parse($str, :actions(GAct1)) };
-}
-
-{
- my class GAct2 {
- method FALLBACK($ , $ ) { }
- }
- bench "grammar (fallback action)", 1, sub () { GTest.parse($str, :actions(GAct2)) };
-}
-
-bench "Any.exists-key", 1000000, sub () { Any<foo>:exists };
-
-my $arr = [1];
-bench "JSON array iteration", 1000000, sub () { to-json($arr) };
+# my $str = "0";
+# $str ~= $str for ^18;
+# say $str.chars;
+# # $str = substr($str,0,1000000);
+#
+# my grammar GTest {
+# token TOP { <.bit>* }
+# token bit { . }
+# }
+#
+# bench "grammar", 1, sub () { GTest.parse($str) };
+# {
+# my class GAct0 {
+# }
+# bench "grammar (no action)", 1, sub () { GTest.parse($str, :actions(GAct0)) };
+# }
+#
+# {
+# my class GAct1 {
+# method bit($ ) { }
+# }
+# bench "grammar (empty action)", 1, sub () { GTest.parse($str, :actions(GAct1)) };
+# }
+#
+# {
+# my class GAct2 {
+# method FALLBACK($ , $ ) { }
+# }
+# bench "grammar (fallback action)", 1, sub () { GTest.parse($str, :actions(GAct2)) };
+# }
+#
+# bench "Any.exists-key", 1000000, sub () { Any<foo>:exists };
+#
+# my $arr = [1];
+# bench "JSON array iteration", 1000000, sub () { to-json($arr) };
View
@@ -28,6 +28,18 @@ use OptRxSimple;
use STD;
use Sig;
+augment class Op::SimplePair { #OK exist
+ method code($body) {
+ CgOp.bif_pair(CgOp.const(CgOp.string_var($.key)), $.value.cgop($body));
+ }
+}
+
+augment class Op::SimpleParcel { #OK exist
+ method code($body) {
+ CgOp.bif_comma(map { $_.cgop($body) }, @$.items);
+ }
+}
+
augment class STD {
token ws () {
:my $startpos = Q:CgOp { (box Num (cast num (cursor_pos (cast cursor (@ {self}))))) };

0 comments on commit cc6a5c3

Please sign in to comment.