Why Perl needs a VM

Matt Sergeant msergeant at messagelabs.com
Tue Sep 4 23:14:08 BST 2007

On 4-Sep-07, at 5:59 PM, ben at bpfh.net wrote:

> Of course, we should also remember that these benchmarks are strictly
> for libxml2, rather than XML::LibXML. I would expect only a trivial
> additive constant time adjustment from Perl's string handling  
> overhead,
> which would be lost in the noise of a 4M document, but it's probably
> worth checking that assumption.

XML::LibXML is pretty much just a basic wrapper - there's a tiny bit  
of overhead in allocating a wrapper struct every time you return from  
XML::LibXML, but as long as you do stuff that's internal to  
XML::LibXML (e.g. xpath queries), then you get no overhead from perl.

> I'll have a proper look when I get some extra tuits - I'm particularly
> interested in how sensitive these numbers are to the ratio of number
> of nodes to size of document, but this is a great signpost.

If you're iterating over nodes (in perl space) then that explains a lot.

Suggest porting whatever you're doing to XSLT if you can. I don't  
know if it's applicable, but it lets you stay in "C-space" for longer.


This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 

More information about the london.pm mailing list