Bug 641735 - Performance issue with perl-XML-SAX-0.14-8
Summary: Performance issue with perl-XML-SAX-0.14-8
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: perl-XML-SAX
Version: 5.5
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Petr Pisar
QA Contact: Petr Šplíchal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-10-10 19:44 UTC by Remi Collet
Modified: 2016-06-01 01:40 UTC (History)
6 users (show)

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.
Clone Of:
Environment:
Last Closed: 2011-11-14 03:06:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Simple test case (697.27 KB, text/plain)
2010-10-10 19:44 UTC, Remi Collet
no flags Details
Test case (697.27 KB, text/plain)
2011-08-26 11:37 UTC, Petr Pisar
no flags Details
Fix back-ported from 0.96 (2.15 KB, patch)
2011-08-26 12:08 UTC, Petr Pisar
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
CPAN 29316 0 None None None Never
Red Hat Product Errata RHBA-2011:1446 0 normal SHIPPED_LIVE perl-XML-SAX bug fix update 2011-11-14 08:02:40 UTC

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


Note You need to log in before you can comment on or make changes to this bug.