Re: [perl #129941] [PERF] [IO] Perl 6 text file line read is much slower than Perl 5

2017-09-12 Thread Tom Browder via RT
On Tue, Sep 12, 2017 at 09:23 jn...@jnthn.net via RT <
perl6-bugs-follo...@perl.org> wrote:

> On Mon, 24 Oct 2016 03:27:55 -0700, tbrowder wrote:
> > On Sat Oct 22 04:24:15 2016, tbrowder wrote:
> > > See  for a suite
> > > of tests that show the differences.
> >
> > Suite has been updated considerably.
>
> 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:

...

> The situation with ASCII/latin-1 is still not quite so rosy:
>
...

> 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...) :-)
>

Jonathan, thanks for your continued work in this area. I agree that "much
slower" is not very specific.  Unless you are aware of some code remaining
to work on someday, I guess we are at the "good enough" point, especially
given that p6 is beating p5 in urf8!

Let me run my tests again to see how it "feels" in my world.

Best,

-Tom


Re: [perl #129941] [PERF] [IO] Perl 6 text file line read is much slower than Perl 5

2017-09-12 Thread Tom Browder
On Tue, Sep 12, 2017 at 09:23 jn...@jnthn.net via RT <
perl6-bugs-follo...@perl.org> wrote:

> On Mon, 24 Oct 2016 03:27:55 -0700, tbrowder wrote:
> > On Sat Oct 22 04:24:15 2016, tbrowder wrote:
> > > See  for a suite
> > > of tests that show the differences.
> >
> > Suite has been updated considerably.
>
> 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:

...

> The situation with ASCII/latin-1 is still not quite so rosy:
>
...

> 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...) :-)
>

Jonathan, thanks for your continued work in this area. I agree that "much
slower" is not very specific.  Unless you are aware of some code remaining
to work on someday, I guess we are at the "good enough" point, especially
given that p6 is beating p5 in urf8!

Let me run my tests again to see how it "feels" in my world.

Best,

-Tom


[perl #129941] [PERF] [IO] Perl 6 text file line read is much slower than Perl 5

2017-09-12 Thread jn...@jnthn.net via RT
On Mon, 24 Oct 2016 03:27:55 -0700, tbrowder wrote:
> On Sat Oct 22 04:24:15 2016, tbrowder wrote:
> > See  for a suite
> > of tests that show the differences.
> 
> Suite has been updated considerably.

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'
6000

real0m1.081s
user0m1.168s
sys 0m0.032s

$ time perl -e 'open my $fh, "<:encoding(UTF-8)", "longfile"; my $chars = 0; 
while ($_ = <$fh>) { chomp; $chars = $chars + length($_) }; close $fh; print 
"$chars\n"'
6000

real0m1.110s
user0m1.088s
sys 0m0.020s

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"'
6000

real0m0.277s
user0m0.260s
sys 0m0.016s

$ time ./perl6-m -e 'my $fh = open "longfile", :enc; my $chars = 0; for 
$fh.lines { $chars = $chars + .chars }; $fh.close; say $chars'
6000

real0m0.988s
user0m1.028s
sys 0m0.068s

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


[perl #129941] [PERF] [IO] Perl 6 text file line read is much slower than Perl 5

2017-09-12 Thread jn...@jnthn.net via RT
On Mon, 24 Oct 2016 03:27:55 -0700, tbrowder wrote:
> On Sat Oct 22 04:24:15 2016, tbrowder wrote:
> > See  for a suite
> > of tests that show the differences.
> 
> Suite has been updated considerably.

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'
6000

real0m1.081s
user0m1.168s
sys 0m0.032s

$ time perl -e 'open my $fh, "<:encoding(UTF-8)", "longfile"; my $chars = 0; 
while ($_ = <$fh>) { chomp; $chars = $chars + length($_) }; close $fh; print 
"$chars\n"'
6000

real0m1.110s
user0m1.088s
sys 0m0.020s

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"'
6000

real0m0.277s
user0m0.260s
sys 0m0.016s

$ time ./perl6-m -e 'my $fh = open "longfile", :enc; my $chars = 0; for 
$fh.lines { $chars = $chars + .chars }; $fh.close; say $chars'
6000

real0m0.988s
user0m1.028s
sys 0m0.068s

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