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
Perl 6 text file line read is much slower than Perl 5 #5765
Comments
From @tbrowderSee <https://github.com/tbrowder/perl6-read-write-tests> for a suite For example (from the link above): Results of recent file read tests Date | Rakudo Version | File Size (lines) | Perl 5
|
From @lizmatWould you believe it used to be a lot slower still? Anyways, what does P6/P5 mean?? If it’s the runtimes divided, I get values between 9 and 10 or so. Which would be less surprising to me.
|
The RT System itself - Status changed from 'new' to 'open' |
From @tbrowderOn Sat Oct 22 04:24:15 2016, tbrowder wrote:
Suite has been updated considerably. |
From @jnthnOn Mon, 24 Oct 2016 03:27:55 -0700, tbrowder wrote:
In a benchmark on my local machine, after many improvements, I now see Perl 6 coming out slightly ahead of Perl 5 when the UTF-8 encoding is being used: $ time perl6 -e 'my $fh = open "longfile"; my $chars = 0; for $fh.lines { $chars = $chars + .chars }; $fh.close; say $chars' real 0m1.081s $ time perl -e 'open my $fh, "<:encoding(UTF-8)", "longfile"; my $chars = 0; while ($_ = <$fh>) { chomp; $chars = $chars + length($_) }; close $fh; print "$chars\n"' real 0m1.110s The situation with ASCII/latin-1 is still not quite so rosy: $ time perl -e 'open my $fh, "<", "longfile"; my $chars = 0; while ($_ = <$fh>) { chomp; $chars = $chars + length($_) }; close $fh; print "$chars\n"' real 0m0.277s $ time ./perl6-m -e 'my $fh = open "longfile", :enc<ascii>; my $chars = 0; for $fh.lines { $chars = $chars + .chars }; $fh.close; say $chars' real 0m0.988s Though that's now down to a factor of 3.5x, which is hugely better than the factor of 9 or 10 before. What are the conditions for resolving this issue? Clearly the UTF-8 case is good enough because Perl 6 is winning there, but "much slower" is a bit subjective, so hard to know when we're there (unless we somehow manage to win in the ASCII case too...) :-) /jnthn |
From @tbrowderOn Tue, Sep 12, 2017 at 09:23 jnthn@jnthn.net via RT <
...
...
Jonathan, thanks for your continued work in this area. I agree that "much Let me run my tests again to see how it "feels" in my world. Best, -Tom |
Migrated from rt.perl.org#129941 (status was 'open')
Searchable as RT129941$
The text was updated successfully, but these errors were encountered: