I have noticed a problem when trying to debug programs that use XML::Simple::XMLin. The program runs very quickly with regular perl, but with "perl -d" or "perl -d:ptkdb" the XMLin line is very slow, taking about 30 seconds even on simple input.

When I interrupt the call under "perl -d", I am always somewhere in utf8_heavy.pl.

tf8::SWASHNEW(/opt/acs/perl/lib/perl5/5.8.0/utf8_heavy.pl:167): 167: my $val = hex(defined $3 ? $3 : "");
Also, I get the following message when using -d:ptkdb, at exit time:
DESTROY created new reference to dead object 'utf8' during global dest +ruction.
Does anyone know of interactions between utf8 and the debugger that would cause slowdowns and reference problems? I am using perl 5.8.0. I have seen the same problem under Linux and Windows NT.

Here is some sample code to reproduce the problem:

use strict; use XML::Simple; my $data; { local $/; $data = <DATA>; } my $config = XMLin($data); print "config read\n"; __DATA__ <config logdir="/var/log/foo/" debugfile="/tmp/foo.debug"> <server name="sahara" osname="solaris" osversion="2.6"> <address>10.0.0.101</address> <address>10.0.1.101</address> </server> <server name="gobi" osname="irix" osversion="6.5"> <address>10.0.0.102</address> </server> <server name="kalahari" osname="linux" osversion="2.0.34"> <address>10.0.0.103</address> <address>10.0.1.103</address> </server> </config>

In reply to XMLin slow in debug mode? by tall_man

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.