Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing an argument list to the export trait slows the parse stage down a lot. #3741

Open
p6rt opened this issue Mar 17, 2015 · 3 comments
Open
Labels

Comments

@p6rt
Copy link

@p6rt p6rt commented Mar 17, 2015

Migrated from rt.perl.org#124098 (status was 'open')

Searchable as RT124098$

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Mar 17, 2015

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.

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Dec 1, 2017

From @AlexDaniel

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​:

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.

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Dec 1, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt p6rt added the perf label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.