develooper Front page | perl.perl5.porters | Postings from August 2014

[perl #122629] [PATCH] sv_grow: performance improvement for short strings

Thread Next
From:
Father Chrysostomos via RT
Date:
August 28, 2014 01:18
Subject:
[perl #122629] [PATCH] sv_grow: performance improvement for short strings
Message ID:
rt-4.0.18-4522-1409188724-47.122629-15-0@perl.org
On Wed Aug 27 11:03:24 2014, rurban@cpanel.net wrote:
> This is a bug report for perl from rurban@cpanel.net,
> generated with the help of perlbug 1.40 running under perl 5.21.4.
> 
> 
> -----------------------------------------------------------------
> sv_grow: performance improvement for short strings
> 
> Rationale:
> Empty COW strings with CUR=0 ended up allocated with LEN=10.
> Now with the small part +2 they are rounded up to 4 or 8.
> Overallocation of larger strings (esp. windows realloc) is
> not affected by the small part. +10 stroke me as very odd.
> 
> Timings with different numbers:
>     +0   16.394324103 +-0.27%
>     +2   16.114379842 +-0.01%
>     +4   16.305622265 +-1.03%
>     +8   16.337438609 +-1.30%
>     +10  16.675009468 +-0.59%
> with LD_LIBRARY_PATH=`pwd` perf stat -r2 ./perl t/harness t/op/*.t
> 
> +2 was consistently the best number, and +10 the worst.
> +0,+4,+8 was about the same.
> 
> All tests:
> +10: (u=7.09  s=1.38  cu=336.32  cs=10.59)
> +8:  (u=6.86  s=1.72  cu=335.03  cs=10.48)
> +2:  (u=6.46  s=1.11  cu=331.08  cs=10.28)
> +0:  (u=6.67  s=1.35  cu=338.26  cs=10.74)

Thank you.  Applied as 880c169.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=122629

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About