Re: Wikipedia dump file processing shoot out

Petr Pajas <[email protected]>
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
2009/12/11 Tyler Riddle <[email protected]>:
>>> Has anyone tried to identify WHY libxml/xslt running in perl is AT ALL
>>> slower than C? Obviously there is SOME going back and forth between perl and
>>> C there, but it kind of seems hideously more expensive than it should be.
>>>
>> There's an old thread about this [1]. Basically the performance penalty
>> comes from the XS interface: invoking an XS method is very expensive [2].
>> I've encounter this when I started writing Xacobeo [3] in which I was
>> displaying an XML document by traversing a DOM tree with XML::LibXML in pure
>> Perl.
>>
>
> I'm really curious why libxml's perl SAX interface performs so poorly
> compared to the others especially because libxml's SAX interface in C
> slightly outperforms expat:
>
>                           'name' => 'libxml.t',
>                           'percentage' => 100,
>
>                           'name' => 'expat.t',
>                           'percentage' => 112,
>
>                           'name' => 'XML-SAX-ExpatXS.t',
>                           'percentage' => 526,
>
>                           'name' => 'XML-Parser.t',
>                           'percentage' => 676,
>
>                           'name' => 'XML-SAX-ExpatXS_nocharjoin.t',
>                           'percentage' => 981,
>
>                           'name' => 'XML-LibXML-SAX.t',
>                           'percentage' => 1082,
>
> Actually now that I look at the data stacked up like that it makes
> perfect sense - it's not really that much slower than expat, it's
> XML::SAX::ExpatXS's character joining feature that is giving it the
> speed benefit. I have RT ticket #52368 open with XML-LibXML to add
> this exact feature but I have not heard anything back on it yet.

Tyler,

I've seen your RT ticket adding this feature to XML-LibXML and it sure
makes sense and I sure do plan to include your patch (or a revised
version of it perhaps) in the next release, so thanks a lot and sorry
for not responding to it right away. I usually answer invalid tickets
as they arrive, but the valid ones I tend to work on in batches when I
have more time.

-- Petr
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.