[prev in list] [next in list] [prev in thread] [next in thread]
List: perl5-porters
Subject: Re: The speed of t/uni/class.t - experimental [PATCH]
From: Rafael Garcia-Suarez <rgarciasuarez () mandriva ! com>
Date: 2005-06-29 14:30:20
Message-ID: 20050629163020.5f7b0556 () grubert ! mandrakesoft ! com
[Download RAW message or body]
Tels wrote:
>
> A: If the tests are not equivalent, what did I do wrong?
The tests are not strictly equivalent. In your version :
+ my $qr = qr/(\p{$blk}+)/; $str =~ /$qr/;
+ is ($1, substr($str, 0, -1)); # all except last char
you don't guarantee that $1 comes from the previous match since you
didn't test that it was successful.
(moreover $str =~ $qr should be sufficient here)
> B: If they are equivalent, why is my routine much faster than the
> construct in the original file? Bug/problem in Perl or Test.pm?
I've absolutely no idea. Looks to me that your version should
be slower.
> B.2: Now matter why it is faster, can we safely rewrite the tests that
> way? That would cut out about 5% of the entire testsuite running time.
Why not, send patches.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic