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

Adding postcircumfix operators makes compilation unacceptably slow #5496

Open
p6rt opened this issue Jul 28, 2016 · 4 comments
Open

Adding postcircumfix operators makes compilation unacceptably slow #5496

p6rt opened this issue Jul 28, 2016 · 4 comments
Labels

Comments

@p6rt
Copy link

@p6rt p6rt commented Jul 28, 2016

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

Searchable as RT128760$

@p6rt
Copy link
Author

@p6rt p6rt commented Jul 28, 2016

From damian@conway.org

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⦌;

@p6rt
Copy link
Author

@p6rt p6rt commented Jul 28, 2016

From @lizmat

Some more discussion about this at​:

http://irclog.perlgeek.de/perl6-dev/2016-07-23#i_12894457

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-archive.perl.org/perl6/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⦌;

@p6rt
Copy link
Author

@p6rt p6rt commented Jul 28, 2016

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

@p6rt
Copy link
Author

@p6rt p6rt commented Feb 16, 2017

From @MasterDuke17

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.

rakudo/rakudo@c99fbc6
Raku/nqp@de70939

@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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.