Skip to content

Commit

Permalink
Make object construction again 1.8x faster
Browse files Browse the repository at this point in the history
It turns out that Mu.bless and Mu.BUILDALL were taking positional
parameters that were never actually given (apart from one arguably
faulty spectest).  This in turn caused flattening on an empty array
to be performed.  And then get passed to BUILDALL, which in turn
didn't do anything with it.  According to spec, bless should take
autovivifying type objects, but this has not been implemented.

Until that happens, it would seem we can use the performance boost
of not allowing positionals towards Mu.bless and Mu.BUILDALL, instead
of silently eating them and not doing anything with them.
  • Loading branch information
lizmat committed Jun 12, 2016
1 parent d76c3fb commit 4179bdc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/Mu.pm
Expand Up @@ -95,11 +95,11 @@ my class Mu { # declared in BOOTSTRAP
nqp::create(self)
}

method bless(*@autovivs, *%attrinit) {
nqp::create(self).BUILDALL(@autovivs, %attrinit);
method bless(*%attrinit) {
nqp::create(self).BUILDALL(%attrinit);
}

method BUILDALL(@autovivs, %attrinit) {
method BUILDALL(%attrinit) {
my $init := nqp::getattr(%attrinit,Map,'$!storage');
# Get the build plan. Note that we do this "low level" to
# avoid the NQP type getting mapped to a Rakudo one, which
Expand Down

0 comments on commit 4179bdc

Please sign in to comment.