Bug#632293: libxml-libxml-perl: findvalue from is very slow (regression)
Vincent Lefevre
vincent at vinc17.net
Fri Jul 1 09:26:32 UTC 2011
Package: libxml-libxml-perl
Version: 1.75.ds-1
Severity: important
Tags: upstream
With libxml-libxml-perl 1.70.ds-1+b1, the following testcase took 0.21s
on my machine, while with 1.75.ds-1, it takes 1.59s.
------------------------------------------------------------
#!/usr/bin/env perl
use strict;
use XML::LibXML;
my $file = 'test-huge.xml';
-e $file and die;
open FILE, '>', $file or die;
print FILE "<?xml version=\"1.0\"?>\n<root>\n" or die;
foreach (1..6000)
{ print FILE "<a attr=\"test\"/>\n" or die; }
print FILE "</root>\n" or die;
close FILE or die;
my $parser = XML::LibXML->new();
my $doc = $parser->parse_file($file);
my $n = 0;
foreach my $node ($doc->findnodes('//a'))
{
my $v = $node->findvalue('@attr');
$v eq 'test' or die;
$n++;
}
print "$n\n";
unlink $file;
------------------------------------------------------------
I had reported the bug here:
https://rt.cpan.org/Public/Bug/Display.html?id=69096
(since I first saw it under Mac OS X). According to the discussion,
this regression comes from a "bug fix", but anyway according to the
DOM spec, the previous behavior was not incorrect and the new behavior
can be regarded as incorrect as it probably makes XML::LibXML fail
to conform to DOM (previous XML::LibXML were also incorrect in this
respect).
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.39-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages libxml-libxml-perl depends on:
ii libc6 2.13-8 Embedded GNU C Library: Shared lib
ii libxml-namespacesupport 1.09-3 Perl module for supporting simple
ii libxml-sax-perl 0.96+dfsg-2 Perl module for using and building
ii libxml2 2.7.8.dfsg-3 GNOME XML library
ii perl 5.12.4-1 Larry Wall's Practical Extraction
ii perl-base [perlapi-5.12 5.12.4-1 minimal Perl system
ii zlib1g 1:1.2.3.4.dfsg-3 compression library - runtime
libxml-libxml-perl recommends no packages.
libxml-libxml-perl suggests no packages.
-- no debconf information
More information about the pkg-perl-maintainers
mailing list