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

Re: proposal for performance testing infrastructure

Thread Previous | Thread Next
From:
H.Merijn Brand
Date:
October 17, 2014 14:29
Subject:
Re: proposal for performance testing infrastructure
Message ID:
20141017162931.204e949f@pc09.procura.nl
On Fri, 17 Oct 2014 14:21:34 +0100, Dave Mitchell <davem@iabyn.com>
wrote:

> On Wed, Oct 15, 2014 at 08:59:03AM +0200, H.Merijn Brand wrote:
> > On Tue, 14 Oct 2014 21:00:29 +0100, Dave Mitchell <davem@iabyn.com>
> > wrote:
> > 
> > > Fourthly, we currently abuse ext/Devel-Peek/t/Peek.t (in a similar manner
> > > to ext/B/t/optree_concise.t) when we want to check SVs for having
> > > particular flags set etc. For similar reasons, I propose a new test file,
> > > t/perf/peek.t say, that will call Dump on an SV of interest, and return a
> > > hash of 'key = value' pairs; for example 
> > > 
> > >     SV = PVAV(0x18a0208) at 0x18c9970
> > >       REFCNT = 1
> > >       FLAGS = ()
> > >       ARRAY = 0x0
> > >       FILL = -1
> > >       MAX = -1
> > >       ARYLEN = 0x0
> > >       FLAGS = (REAL)
> > > 
> > > might be returned as the simple hash
> > > 
> > >     {
> > >         SV     => 'PVAV(0x18a0208) at 0x18c9970',
> > >         REFCNT => '1',
> > >         FLAGS  => '()',
> > >         ARRAY  => '0x0',
> > >         FILL   => '-1',
> > >         MAX    => '-1',
> > >         ARYLEN => '0x0',
> > >         FLAGS  => '(REAL)',
> > >     }
> > 
> > I did so in Data::Peek
> 
> Ah, interesting.
> 
> I was assuming that (possibly with mods) I would be able to make
> Peek.xs expose an API that allows you pass in a filehandle, then pass
> in a filehandle that's been opened to a var.

It is already possible with do_sv_dump (0, io, sv, 1, level, 1, 0);
implemented in Data::Peek's DDump_IO

        my $dump;
        open my $fh, ">", \$dump;
        DDump_IO ($fh, \%hash, 6);
        close $fh;
        print $dump;



-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.21   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/        http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/

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