On Fri, May 07, 2004 at 06:57:24PM +0200, Leopold Toetsch wrote:
> Nicholas Clark <[EMAIL PROTECTED]> wrote:
> > With all the perl scalars now indirecting through PMCs, Ponie's performance
> > has dropped. Not surprising, in the general case, but the performance of
> > lib/locale.t is vile, and I'm wondering if that regression test hits
> > something pathological. It slows to a crawl after subtest 99 (line 240 in
> > http://public.activestate.com/cgi-bin/perlbrowse?file=lib%2Flocale.t&rev=
> > search for the text Find locales
> > )
> 
> > I built ponie with profiling, and I find that it's spending an inordinate
> > amount of time in trace_children (half a second per call):
> 
> That's very likely caused by GC_DEBUG. Hash lookup calls string_equal
> which triggers a DOD run on *each* string compare. Please recompile
> parrot with DISABLE_GC_DEBUG=1 in parrot.h. That could help. But see
> below.

I tried building with -DDISABLE_GC_DEBUG=1 and the build fails:

./parrot parrot-config.imc VERSION DEVEL
parrot: src/platform.c:665: Parrot_memcpy_aligned_sse_debug: Assertion `((unsigned 
long) d & 7) == 0' failed.
make: *** [library/config.fpmc] Aborted
make: *** Deleting file `library/config.fpmc'

Like the profiles, this is on:

$ uname -a
Linux switch.work.fotango.com 2.6.4 #2 SMP Thu Mar 11 18:01:19 GMT 2004 i686 unknown

It's the main Fotango development box, and has 4G of RAM.


> > Flat profile:
> 
> > Each sample counts as 0.000999001 seconds.
> >   %   cumulative   self              self     total
> >  time   seconds   seconds    calls  ms/call  ms/call  name
> >  29.55    379.89   379.89     2381   159.55   503.64  trace_children
> >  26.06    714.95   335.06 1337922049     0.00     0.00  pobject_lives
>                             ^^^^^^^^^^
> 
> Boy that's a lot.
> 
> >   0.07   1266.73     0.86  9459863     0.00     0.13  get_free_object_df
>                              ^^^^^^^
> 
> How big is the live data set during that test? Seems to be rather big.

How do I best measure this? The line from top (without GC debug) is:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
31469 nick      25   0  236m  57m 173m R 99.9  1.4   0:16.64 perl              


> I don't see any reference to add_free_object, so I presume the test is
> shuffling 9.5 M PMCs around. How much RAM has your machine?

4Gb. Presumably Linux can only give 2Gb to any one process. 5Gb of swap.

On Fri, May 07, 2004 at 08:42:42PM +0200, Leopold Toetsch wrote:

> One more question: Looking at the test, there seems to be a lot of stuff 
> collected in @Locale: How do these PMCs look like? And how many entries 

As in a gdb dump? Or a description? Assuming description, ponie is
allocating lots of Perl5... PMCs, currently done as programmatic cut&paste
from the template file ponie/src/pmc/perl5cargo_cult.pmc
http://cvs.perl.org/cgi/cvsweb.cgi/ponie/src/pmc/perl5cargo_cult.pmc?rev=1.5&content-type=text/x-cvsweb-markup

The PMC only used the PMC_data member to store a pointer on to a perl5
SV body. So the array @Locale will be a perl5 SV head pointing to a
perl5PVAV PMC, which in turn will point to a perl5 PVAV structure.
(An array). That will have a pointer to a (perl5 managed, malloc()d) buffer
which will have pointers to perl5 SVs.

(which in turn will be perl SV heads pointing to PMCs, probably perl5PVs,
in turn pointing to perl5 PV structures for the SV's body)

This mess is the interim structure - pretty much the next thing for ponie
is to eliminate those perl5 bodies hanging off the PMCs and store the
relevant data directly.

> has @Locale?

342

(C and POSIX are duplicated for some reason)

Looks like switch has just about every locale installed.

Nicholas Clark

Reply via email to