Bug 641735

Summary: Performance issue with perl-XML-SAX-0.14-8
Product: Red Hat Enterprise Linux 5 Reporter: Remi Collet <fedora>
Component: perl-XML-SAXAssignee: Petr Pisar <ppisar>
Status: CLOSED ERRATA QA Contact: Petr Šplíchal <psplicha>
Severity: medium Docs Contact:
Priority: low    
Version: 5.5CC: ohudlick, ppisar, psabata, psplicha, rvokal, xavier
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: perl-XML-SAX-0.14-10 Doc Type: Bug Fix
Doc Text:
Cause Parsing long XML document through XML::Simple API if XML::SAX parser implementation is available. Consequence The parser running time is unacceptably long. Fix XML::SAX parser copied XML string on each token match. More efficient handling of consequent reading has been back-ported. Result Long XML documents are parsed in reasonable time.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-14 03:06:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Simple test case
none
Test case
none
Fix back-ported from 0.96 none

Description Remi Collet 2010-10-10 19:44:28 UTC
Created attachment 452609 [details]
Simple test case

With the simple test attached, we notice really big perfomance issue when parsing large input which seems related to 
https://rt.cpan.org/Public/Bug/Display.html?id=29316
This issue is not present with more recent version

***** Test on Fedora 14 (perl-XMl-SAX-0.96-10)

# yum install perl-XML-Simple

$ time perl testxml.pl 
Request length : 714002
Parsed length : 15
real	0m0.829s

# yum install perl-XML-SAX

$ time perl testxml.pl 
Request length : 714002
Parsed length : 15
real	0m16.643s

***** Test on Red Hat Enterprise Linux 5.5

# yum install perl-XML-Simple

$ time perl /tmp/testxml.pl 
Request length : 713976
Parsed length : 16
real	0m0.890s

# yum install perl-XML-SAX

$ time perl /tmp/testxml.pl 
Request length : 713976
Parsed length : 16
real	9m20.425s

Comment 1 Remi Collet 2010-10-10 20:08:24 UTC
Of course, in the attached test case, the line 
$XML::Simple::PREFERRED_PARSER = 'XML::Parser'
Should be removed... (this is a workround to this issue)

Comment 2 Marcela Mašláňová 2010-10-11 07:17:31 UTC
Thanks for your report. Patch looks applicable on RHEL-5 version.

Comment 4 Petr Pisar 2011-08-26 11:37:53 UTC
Created attachment 520073 [details]
Test case

This is stricter version of original test case to prevent unintended here-document expansion.

Comment 5 Petr Pisar 2011-08-26 12:08:00 UTC
Created attachment 520075 [details]
Fix back-ported from 0.96

Comment 7 Petr Pisar 2011-10-06 07:37:47 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
    Parsing long XML document through XML::Simple API if
    XML::SAX parser implementation is available.
Consequence
    The parser running time is unacceptably long.
Fix
    XML::SAX parser copied XML string on each token match.
    More efficient handling of consequent reading has been
    back-ported.
Result
    Long XML documents are parsed in reasonable time.

Comment 12 errata-xmlrpc 2011-11-14 03:06:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1446.html