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

very slow $*.IN reading #1251

Closed
p6rt opened this issue Aug 24, 2009 · 7 comments
Closed

very slow $*.IN reading #1251

p6rt opened this issue Aug 24, 2009 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Aug 24, 2009

Migrated from rt.perl.org#68762 (status was 'rejected')

Searchable as RT68762$

@p6rt
Copy link
Author

p6rt commented Aug 24, 2009

From alex@framexpeditions.com

Hello

totally enthusiastic after Damian talk on perl6 in Switzerland last
week, I tried this morning, to make a little script.
However, the script was taking age just to count lines.

last rakudo download, on mac OS X

here are 2 code, one in perl6 and perl 5
rakudo
#!/usr/local/parrot_install/bin/perl6

my $n=0;
for $*IN.lines->$line{
  $n++;
}
say "n=$n";

and the "old" variant
#!/usr/bin/env perl
use strict;
use warnings;

my $n=0;
while (my $line=<STDIN>){
  $n++;
}
print "n=$n\n";

so I made 4 files, with 1, 10, 100 ... 10000 lines (text, approx 100
char per line)
code timings (with the command) for i in 1 10 100 1000 10000; do echo
"number of lines=$i"; time ./easy-aligned-p5.pl </tmp/a-$i.txt; done

"user" time is reported, in seconds

nblines perl 5 perl 6 `wc -l`
1 .011 .96 .001
10 .005 1.0 .001
100 .005 1.3 .000
1000 .005 4.4 .001
10000 .015 36 .002

Well, is there a problem here, or just something I have not understood
(I hoped for ($*IN.lines)->$line wa doing some lazy reading, no?)

Tahnks for al the effort with rakudo which look totally great anyway!
Alex

Go North! Go Wild! Fram!
http://www.framexpeditions.com

@p6rt
Copy link
Author

p6rt commented Aug 24, 2009

From @moritz

On Mon Aug 24 03​:06​:31 2009, alex_mass wrote​:

so I made 4 files, with 1, 10, 100 ... 10000 lines (text, approx 100
char per line)
code timings (with the command) for i in 1 10 100 1000 10000; do echo
"number of lines=$i"; time ./easy-aligned-p5.pl </tmp/a-$i.txt; done

"user" time is reported, in seconds

nblines perl 5 perl 6 `wc -l`
1 .011 .96 .001
10 .005 1.0 .001
100 .005 1.3 .000
1000 .005 4.4 .001
10000 .015 36 .002

Well, is there a problem here, or just something I have not understood

Rakudo is currently much slower (typically a factor 500) than Perl 5.
That's know and being worked on.

(I hoped for ($*IN.lines)->$line wa doing some lazy reading, no?)

It should, but it's not yet implemented.

Cheers,
Moritz

@p6rt
Copy link
Author

p6rt commented Aug 24, 2009

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

@p6rt
Copy link
Author

p6rt commented Aug 25, 2009

From alex@framexpeditions.com

Thanks for the answer,

Therefore we'll keep eyes open when the speed improves a little bit.
Because all what Damian showed us last week was just astonishing!

But unfortunately, we have little problems here with less than
thousands of input in our domain of life science.

looking at the raduko web site lokks to be the place where to be aware
of what is happening.

Thanks again for all the effor tyou put in

cheers
Alex

On Aug 24, 2009, at 7​:00 PM, Moritz Lenz via RT wrote​:

On Mon Aug 24 03​:06​:31 2009, alex_mass wrote​:

so I made 4 files, with 1, 10, 100 ... 10000 lines (text, approx 100
char per line)
code timings (with the command) for i in 1 10 100 1000 10000; do echo
"number of lines=$i"; time ./easy-aligned-p5.pl </tmp/a-$i.txt; done

"user" time is reported, in seconds

nblines perl 5 perl 6 `wc -l`
1 .011 .96 .001
10 .005 1.0 .001
100 .005 1.3 .000
1000 .005 4.4 .001
10000 .015 36 .002

Well, is there a problem here, or just something I have not
understood

Rakudo is currently much slower (typically a factor 500) than Perl 5.
That's know and being worked on.

(I hoped for ($*IN.lines)->$line wa doing some lazy reading, no?)

It should, but it's not yet implemented.

Cheers,
Moritz

Go North! Go Wild! Fram!
http://www.framexpeditions.com

@p6rt
Copy link
Author

p6rt commented Jun 30, 2010

From @bbkr

[14​:51] <colomon> bbkr​: lines is lazy now, but it might still be slow.
probably worth testing.

@p6rt
Copy link
Author

p6rt commented Jun 30, 2010

From @bbkr

[14​:54] <bbkr> colomon​: thanks. what status should ticket have then?
there is no "acceptable" speed level defined, "very slow" is too
general, at which point we can reply "resolved"?
[14​:58] <masak> bbkr​: I'd just reject the ticket. but I'm known to be
very unsentimental about these things, so maybe check with someone else too.
[15​:03] <bbkr> masak​: I also think it should be rejected. The only
precisely described issue (.lines not being lazy) is now solved.
[15​:03] <masak> bbkr​: nod.

[15​:04] <masak> bbkr​: it's worth noting, of course, that the submitter
considers Rakudo to be so slow that the problem doesn't even need to be
explicitly pointed out :)
[15​:04] <masak> but that says more about the expectations of the
submitter (and perhaps our relative tolerance) than anything else.

So rejecting.

@p6rt
Copy link
Author

p6rt commented Jun 30, 2010

@bbkr - Status changed from 'open' to 'rejected'

@p6rt p6rt closed this as completed Jun 30, 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant