I spent the better part of the afternoon optimising XML::SAX::Expat and XML::NamespaceSupport, with the help of Barrie and Matt. It's fun! XML::SAX::Expat is now 60% slower than XML::LibXML::SAX::Parser, instead of 80%, which means a 25% speedup.
This was triggered by a Lincoln Stein post about the slowness of parsers (he has a typo, when he writes XML::Parse::Expat he means XML::SAX::Expat). Of course, his benchmark is flawed in a few ways, notably that HTML::Parser doesn't parse XML (well it does, but it won't fail on ill-formed documents) and neither it nor XML::Parser were configured to report namespaces.
Nevertheless, the difference would only be decreased slightly, not anihilated. So I decided to see where I could shave off some time. In his given example, XML::SAX::Expat would now run in 128s instead of 144. XML::SAX::PurePerl would probably run faster as well because it also uses XML::NamespaceSupport which has had a serious performance boost.
I'll be releasing these modules when I've tested that they're stable under these new conditions, and integrated some patches from Grant in XNSS.
On another front, Matt has started to work on an XS version of XML::SAX::Expat (it currently is layered over XML::Parser, which is a huge waste). I'm glad he's taken that over because while I've understood how XS works and how to get args, munge them into hash, call a method (which is rather trivial) I find that the XS processor is really braindead and keeps complaining about tons of things without really being very informative about it. It took me all of two hours to understand that it was bitching about a simple comment that wasn't where it wanted to see it... I pretty much left it there, frustrated with so much braindeadness.
We've also been considering XS versions of XML::NamespaceSupport and XML::SAX::Base, that would be built if the user wishes to have them (the Perl versions have to stay). If someone wishes to volunteer, it oughn't be hard and it'd help lots. Otherwise, it'll prolly happen at some point.