Why Perl needs a VM
Jesse Vincent
jesse at fsck.com
Tue Sep 4 19:42:18 BST 2007
>>
>> You mention below that you are thinking of re-writing parts of the
>> app
>> in Java, because of the slow Pure-Perl performance.. can you instead
>> just swap to using a Perl module that evaluates the XPaths via a C
>> implementation, thus gaining the speed advantage over Java again, as
>> with the regexes?
>> (I think XML::LibXML::XPathContext is an example of such?)
>
> I've had a poke at the code and sure enough, we're using
> XPathContext, which
> I'd thought was a pure perl piece on top of XML::LibXML. It isn't -
> it's got
> a C implementation at its heart.
>
> The Java implementation is still substantially quicker. I want to
> drill in
> on the numbers, and the Java libs are probably proprietary, so I
> may not be
> able to post any numbers, but I am now pretty convinced that the
> "Java, therefore
> slow" mantra really isn't true any more, at least in this application.
>
Nope. If you want to make fun of another language for being slower
than Perl, Ruby is the recommended target. But I can easily believe
that a commercial, optimized parsing engine is going to be faster
than XML::LibXML I'm not sure I saw earlier if you said that you or
your -orkers had spent time with Devel::DProf looking at what's
making your perl code slow. Rewriting slow code with an eye toward
improved performance is going to be faster...even if you write it in
Ruby ;)
-j
More information about the london.pm
mailing list