Perl 5 Porters Weekly: October 7-October 13, 2012
Welcome to Perl 5 Porters Weekly, a summary of the email traffic of the perl5-porters email list. Sorry this week's summary was delayed, I just ran out of tuits this past weekend. Let's get right to the topics this week:
- Perl 5.14.3 is now available
- maint-5.12, maint-5.14, and CVE-2012-5195
- perl 5.16.2 cometh
- Stupid COW benchmarks
- aasign'ing hash with odd number of elements and duplicates
- Compile option to disable taint mode: speedup
- Making PerlIOStdio_invalidate_fileno() less invasive on FreeBSD
Perl 5.14.3 is now available
Dominic Hargreaves announced that perl 5.14.3 is now available on a CPAN mirror near you.
maint-5.12, maint-5.14, and CVE-2012-5195
Ricardo Signes announced that he'd pushed a CVE fix to the maintenance branches of perl-5.14.3 and perl-5.12.5.
perl 5.16.2 cometh
In another announcement, Ricardo posted that he'd applied the fixes he knew needed backporting to maint that didn't make it into 5.16.1. He encouraged people to speak up about other patches which should be considered for inclusion into 5.16.2 in early November.
Stupid COW benchmarks
Father Chrysostomos announced that he'd finished some work on a Copy-on-Write perl.
To do COW with a refcount stored in the string buffer, we have to check that SvLEN is at least two bytes greater than SvCUR and than the reference count has not reached 255. That overhead slows down COW.
He shows that for short strings (i.e., "hello") assigned a million times, no-COW overhead is a winner by a second. But for long strings ("hello" x 1000) assigned a million times, COW is a winner by almost 3.5 seconds.
aasign'ing hash with odd number of elements and duplicates
Ruslan Zakirov wrote that he's uncovered some odd behavior when Perl is given a list with an odd number of elements and some duplicates.
If a hash is assigned with odd number of elements then we get a warning, but code continues and return values should be maintained. Simple case: $ perl -E 'say scalar %h = (1..3)' 1:2:3 $ perl -E 'say scalar(%h = (1..3))' 3 Quite resonable results from the first glance and reproducible since 5.8.9 to blead. Things get messy with duplicates: $ perl -e 'print join ":", (%h = (1,2,3,4,1)), "\n"' 1:2:3:4:1: Older versions produce different result, but it's not important. If we say that the case without duplicates produces correct and expected results then result in the last situation should be "3:4:1". It's important to note that order matters here, it can not be "1:3:4".
He offers some potential solutions and there is a good bit of back and forth about whether this behavior is expected or an error.
Compile option to disable taint mode: speedup
Steffen Mueller made an experimental patch to completely disable the tainting mechanisms in Perl as a compile option to provide a bit more speed than usual. (He estimates this makes Perl 10-20% faster than normal.)
I would NOT want this to be the default behaviour, but having this an option could be a boon to people like my employer, who run Perl on thousands of machines and capacity is as important as latency. (Thus the eternal "you spend more time waiting for IO" doesn't apply.) I would love some review of the changes to the effect of what you think needs doing in order to get this into blead. Just to reiterate: This would be an opt-in perl.o-compile-time option to disable taint support in the perl binary.
He's looking for some additional feedback on this option.
Making PerlIOStdio_invalidate_fileno() less invasive on FreeBSD
I'm afraid this note to p5p has been warnocked. John Baldwin wrote that he's working on the stdio bits in FreeBSD's libc implementation and wants to insulate a call in Perl's IO layer to a member of a struct he wants to make private. He's looking for some direction on how this ought to be accomplished.