Hi,

I did have the idea last week to look at how Perl processes unicode data
and see if I can streamline that. However, good benchmarks/profiling must
come first.

For large strings, repeated operations etc, the time difference can grow
very large.

I started to put some test scripts together, and came across some interesting results. I started with basic parameter passing (to and from XS) and for the most part there is very little difference between 5.6.1 and 5.8.7. For a few things 5.8.7 was slightly faster.

As soon as you use SV's as strings things start to get bad... For example:

void SVManipulation()
CODE:
 SV* SVstring;
 SVstring = newSVpvn("Some",4);
 sv_catpvn(SVstring,"AA",2);
 sv_catpvn(SVstring,"BBB",3);
 sv_catpvn(SVstring,"CCCC",4);
 SvREFCNT_dec(SVstring);

Gave me the following results:

5.8.7
Benchmark: timing 10000000 iterations of SVManipulation...
SVManipulation: 22 wallclock secs (22.17 usr + 0.02 sys = 22.19 CPU) @ 450694.07/s (n=10000000)

5.6.1
Benchmark: timing 10000000 iterations of SVManipulation...
SVManipulation: 10 wallclock secs ( 9.81 usr + 0.00 sys = 9.81 CPU) @ 1019160.21/s (n=10000000)

Next I was going to test the performance of hash access in xs, but before I do, I just want to confirm that I'm being "fair" in my testing. I'm using ActiveState for both versions, same version of GCC and using Benchmark for timings. All test code is the same for both versions.

Cheers,

jez.


Reply via email to