On Wed, Jan 29, 2003 at 02:10:03AM +0100, Martin Nilsson (�skblod) @ Pike (-) developers forum wrote:
a = a[1..]; a += ({ some_value });
This is quite slow, especially for big arrays :)
And mappings would help here, or what is your point? That inappropriate use of a datatype is slower than using the right one (ADT.Queue)?
ADT.Queue is using arrays to implemet queues anyway, where is the advantage?
But that is wrong. Running regexp tests written purely in C using the PCRE library is 13% slower than the same tests run in Perl.
??? Just tested:
aldem@fort:/old/home/aldem/src/pcre-3.9$ time ./perltest testdata/testinput1 > /dev/null
real 0m2.194s user 0m2.190s sys 0m0.010s aldem@fort:/old/home/aldem/src/pcre-3.9$ time ./pcretest testdata/testinput1 > /dev/null
real 0m0.065s user 0m0.040s sys 0m0.020s
So where is the Perl's advantage? I did similar benchmars long time ago too, results were very similar (this test was with PCRE 3.9 and Perl 5.6.1).
Java, which is 22% slower than Python. To call Pike regexps slow is simply not true.
For some particular tasks - may be, but they are less powerful. And, again, PCRE gives us Perl compatibily, which may simplify porting from Perl (and anyway PCRE is in use in PHP/Apache etc - a lot of places).
I may add similar tests functionality using my PCRE module for Pike and publish the results, if someone is interested...
And to think that the performance is going to improve without doing something drastic, like writing a new regexp engine from scratch, is to be unrealistic IMHO.
Please, please, do some benchmarks first :)
Regards, /Al