Skip Menu |
Report information
Id: 128760
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: thoughtstream <damian [at] conway.org>
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



To: rakudobug [...] perl.org
From: Damian Conway <damian [...] conway.org>
Subject: [BUG] Adding postcircumfix operators makes compilation unacceptably slow
Date: Thu, 28 Jul 2016 10:46:35 +1000
> perl6 --version
This is Rakudo version 2016.07.1 built on MoarVM version 2016.07
implementing Perl 6.c.

Adding a new postcircumfix operator increases compile-time by over 1 second per operator definition.
For example:

BEGIN my $start = now;
BEGIN { say "Compiling..." };
INIT  { say "Compiled after {now - $start} seconds"; }
END   { say "Done after {now - $start} seconds"; }

multi postcircumfix:« ⦋ ⦌ » (Any $prob, Any $state) {
    $state => $prob
}
BEGIN  { say "First definition after {now - $start} seconds"; }

multi postcircumfix:« ⦋ ⦌ » (Numeric $prob, Any $state) {
    $state => $prob
}
BEGIN  { say "Second definition after {now - $start} seconds"; }

multi postcircumfix:« ⦋ ⦌ » (Str $prob, Any $state) {
    $state => $prob
}
BEGIN  { say "Third definition after {now - $start} seconds"; }

multi postcircumfix:« ⦋ ⦌ » (Int $prob, Any $state) {
    $state => $prob
}
BEGIN  { say "Fourth definition after {now - $start} seconds"; }

say   0.5⦋'cat'⦌;
say 'cat'⦋0.5⦌;
say 'cat'⦋'cat'⦌;
say     1⦋'cat'⦌;
say     1⦋1⦌;
To: "Damian Conway (via RT)" <perl6-bugs-followup [...] perl.org>
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
Subject: Re: [perl #128760] [BUG] Adding postcircumfix operators makes compilation unacceptably slow
Date: Thu, 28 Jul 2016 09:56:55 +0200
Download (untitled) / with headers
text/plain 1.5k
Some more discussion about this at: http://irclog.perlgeek.de/perl6-dev/2016-07-23#i_12894457 Show quoted text
> On 28 Jul 2016, at 02:47, Damian Conway (via RT) <perl6-bugs-followup@perl.org> wrote: > > # New Ticket Created by Damian Conway > # Please include the string: [perl #128760] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=128760 > > >
>> perl6 --version
> This is Rakudo version 2016.07.1 built on MoarVM version 2016.07 > implementing Perl 6.c. > > Adding a new postcircumfix operator increases compile-time by over 1 second > per operator definition. > For example: > > BEGIN my $start = now; > BEGIN { say "Compiling..." }; > INIT { say "Compiled after {now - $start} seconds"; } > END { say "Done after {now - $start} seconds"; } > > multi postcircumfix:« ⦋ ⦌ » (Any $prob, Any $state) { > $state => $prob > } > BEGIN { say "First definition after {now - $start} seconds"; } > > multi postcircumfix:« ⦋ ⦌ » (Numeric $prob, Any $state) { > $state => $prob > } > BEGIN { say "Second definition after {now - $start} seconds"; } > > multi postcircumfix:« ⦋ ⦌ » (Str $prob, Any $state) { > $state => $prob > } > BEGIN { say "Third definition after {now - $start} seconds"; } > > multi postcircumfix:« ⦋ ⦌ » (Int $prob, Any $state) { > $state => $prob > } > BEGIN { say "Fourth definition after {now - $start} seconds"; } > > say 0.5⦋'cat'⦌; > say 'cat'⦋0.5⦌; > say 'cat'⦋'cat'⦌; > say 1⦋'cat'⦌; > say 1⦋1⦌;
Download (untitled) / with headers
text/plain 439b
This was made a little bit faster with Rakudo commit c99fbc67938479b518919d1651fd05db9f9f42ed, which brought in NQP commit de709396b6c267144e8a40d510764b7a91c90662. There is still the same amount of logical redundant work being done, but at least the redundant stuff runs faster. https://github.com/rakudo/rakudo/commit/c99fbc67938479b518919d1651fd05db9f9f42ed https://github.com/perl6/nqp/commit/de709396b6c267144e8a40d510764b7a91c90662


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org