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

Owner: Nobody
Requestors: perl6 [at] reproducible.io
Cc:
AdminCc:

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



Subject: [BUG] Passing an argument list to the export trait slows the parse stage down a lot.
To: rakudobug [...] perl.org
Date: Tue, 17 Mar 2015 13:59:36 +0100
From: perl6 [...] reproducible.io
First reduced test-case (no argument): constant C1 is export = 1; constant C2 is export = 2; constant C3 is export = 3; constant C4 is export = 4; constant C5 is export = 5; constant C6 is export = 6; constant C7 is export = 7; constant C8 is export = 8; constant C9 is export = 9; constant C10 is export = 10; constant C11 is export = 11; constant C12 is export = 12; constant C13 is export = 13; constant C14 is export = 14; constant C15 is export = 15; constant C16 is export = 16; constant C17 is export = 17; constant C18 is export = 18; constant C19 is export = 19; constant C20 is export = 20; Second reduced test-case (empty argument list): constant C1 is export() = 1; constant C2 is export() = 2; constant C3 is export() = 3; constant C4 is export() = 4; constant C5 is export() = 5; constant C6 is export() = 6; constant C7 is export() = 7; constant C8 is export() = 8; constant C9 is export() = 9; constant C10 is export() = 10; constant C11 is export() = 11; constant C12 is export() = 12; constant C13 is export() = 13; constant C14 is export() = 14; constant C15 is export() = 15; constant C16 is export() = 16; constant C17 is export() = 17; constant C18 is export() = 18; constant C19 is export() = 19; constant C20 is export() = 20; Using ``perl6 --stagestats`` to compare these reduced test-cases, the parse stage is way slower when an argument list is passed to the export trait: ================ =========== ============== ======== CPU no argument empty argument slowdown ================ =========== ============== ======== Core 2 Duo L9400 0.4s 1.4s x3.5 Atom CPU D525 1.3s 5.2s x4.0 ================ =========== ============== ======== Please note that the slowdown is the same when the argument list isn't empty, for instance when using ``is export(:tag)``. PS: almost all export traits in NativeCall.pm have an argument list.
I can reproduce. The difference at 2017.11-36-g78caeb6bc is ≈0.133s vs ≈0.732s
On 2015-03-17 05:58:27, perl6@reproducible.io wrote:
Show quoted text
> First reduced test-case (no argument):
>
> constant C1 is export = 1;
> constant C2 is export = 2;
> constant C3 is export = 3;
> constant C4 is export = 4;
> constant C5 is export = 5;
> constant C6 is export = 6;
> constant C7 is export = 7;
> constant C8 is export = 8;
> constant C9 is export = 9;
> constant C10 is export = 10;
> constant C11 is export = 11;
> constant C12 is export = 12;
> constant C13 is export = 13;
> constant C14 is export = 14;
> constant C15 is export = 15;
> constant C16 is export = 16;
> constant C17 is export = 17;
> constant C18 is export = 18;
> constant C19 is export = 19;
> constant C20 is export = 20;
>
> Second reduced test-case (empty argument list):
>
> constant C1 is export() = 1;
> constant C2 is export() = 2;
> constant C3 is export() = 3;
> constant C4 is export() = 4;
> constant C5 is export() = 5;
> constant C6 is export() = 6;
> constant C7 is export() = 7;
> constant C8 is export() = 8;
> constant C9 is export() = 9;
> constant C10 is export() = 10;
> constant C11 is export() = 11;
> constant C12 is export() = 12;
> constant C13 is export() = 13;
> constant C14 is export() = 14;
> constant C15 is export() = 15;
> constant C16 is export() = 16;
> constant C17 is export() = 17;
> constant C18 is export() = 18;
> constant C19 is export() = 19;
> constant C20 is export() = 20;
>
> Using ``perl6 --stagestats`` to compare these reduced test-cases, the
> parse stage is way slower when an argument list is passed to the
> export trait:
>
> ================ =========== ============== ========
> CPU no argument empty argument slowdown
> ================ =========== ============== ========
> Core 2 Duo L9400 0.4s 1.4s x3.5
> Atom CPU D525 1.3s 5.2s x4.0
> ================ =========== ============== ========
>
> Please note that the slowdown is the same when the argument list isn't
> empty, for instance when using ``is export(:tag)``.
>
> PS: almost all export traits in NativeCall.pm have an argument list.




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