develooper Front page | perl.perl5.porters | Postings from July 2015

Re: For 5.24: suggested incompatible changes

Thread Previous | Thread Next
From:
Reini Urban
Date:
July 7, 2015 09:48
Subject:
Re: For 5.24: suggested incompatible changes
Message ID:
559BA05E.1090301@cpanel.net
On 07/01/2015 09:42 PM, Jim Cromie wrote:
> On Sat, Jun 27, 2015 at 1:53 AM, Reini Urban <reini@cpanel.net> wrote:
> 
> 
>>
>>
>> PERLIO_DEBUG only with DEBUGGING, use for all -D*
>> -------------------------------------------------
>>
>> PerlIO_debug() is currently called even without DEBUGGING, making perlio
>> slower than it needs to be.
>>
>> * our changes wrap PerlIO_debug into a new DEBUG_I(),
>> thus enable PERLIO_DEBUG only with DEBUGGING, and we use the debugio_fh
>> for all DEBUG_* macros. so we can seperate -D* tracing from STDERR.
>>
>> the name can stay the same, as PERLIO_DEBUG=filename is already
>> established, and letting -D* write into this handle seems natural to us.
>>
>>
> at 1st glance, this would appear to fix 122 test failures in
> -Accflags=-DPERL_TRACE_OPS builds,
> especially in t/run/fresh_perl.t
> 
> $ ./perl -Ilib t/run/fresh_perl.t 2> bar >foo
> $ more foo
> 1..92
> not ok 1 - $a = ":="; @_ = split /($a)/o, "a:=b:=c"; print "@...
> not ok 2 - $cusp = ~0 ^ (~0 >> 1);
> not ok 3 - $foo=undef; $foo->go;
> not ok 4 - BEGIN
> not ok 5 - $array[128]=1
> not ok 6 - $x=0x0eabcd; print $x->ref;
> not ok 7 - chop ($str .= <DATA>);
> not ok 8 - close ($banana);
> not ok 9 - $x=2;$y=3;$x<$y ? $x : $y += 23;print $x;
> not ok 10 - eval 'sub bar {print "In bar"}';
> not ok 11 - system './perl -ne "print if eof" /dev/null'
> ...
> 
> 
> That said, Im a bit concerned that fresh-perl tests rely on catching
> unexpected stderr,
> and calling it a "not ok"
> 
> It does seem clean to separate -D* debug output, since it isnt really
> unexpected when -D* is given,
> 
> are these related issues why you deem this to be an incompatible change ?

It is incompatible because I hijack the existing semantics of
PERLIO_DEBUG and apply it to all DEBUG_* flags.

Previously PERLIO_DEBUG worked on non-debugging builds to get PerlIO
traces into a file.

My suggestion is that this feature slows down PerlIO for non-DEBUGGING
builds, and we should hijack it for all DEBUG options, to pass an
optional filename.
We could of course a new ENV for this, like PERL_DEBUG_FILE. Then it
would not be incompatible.

My patch on github works fine for all variants, and esp. helps with new
debugging flags to print them into a seperate file, while not polluting
STDERR. Thus I can run the normal testsuite with it.

I created the updated https://github.com/rurban/perl-hash-stats with
that, with the interesting result that schmorp's FNV1A choice is the
best hash function for perl in practice, even if it creates more
collisions and is slower then bigger specialized functions when being
benchmarked in simple loops.



Thread Previous | 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