Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Mark $name parameter in symbol a str.
Eliminates the most common source of box allocations in compilation.
For example, in the `for ^500 { EVAL 'regex { abcdef }' }` example we
knock several hundred thousand allocations, and 3 whole GC runs, off.
  • Loading branch information
jnthn committed Mar 9, 2016
1 parent ae15d62 commit c8db98b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/QAST/Block.nqp
Expand Up @@ -56,7 +56,7 @@ class QAST::Block is QAST::Node does QAST::Children {
}

my %NOSYMS := nqp::hash();
method symbol($name, *%attrs) {
method symbol(str $name, *%attrs) {
%!symbol := nqp::hash() if nqp::isnull(%!symbol);
if %attrs {
my %syms := %!symbol{$name};
Expand Down

0 comments on commit c8db98b

Please sign in to comment.