http://qs321.pair.com?node_id=267324


in reply to XML::Parser Streams performing undesired buffering

I think the significant value can be found in the file:expat.xs (part of the XML::Parser package) which has this at line 35

#define BUFSIZE 32768

Which suggests that you might be able to rebuild just the xs part of the package to adjust the buffersize.

That said, there is no guarentee that this will work or would fix your problem. I've never tried using XML::Parser in stream mode, but I wonder how effective it is for real-time parsing of streaming XML-like data? It appears to geared more to parsing fully complient XML documents rather than XML-like streams.

If its important for your application to decode XML-like markup in a timely manner, you may have to consider using something like XML::Parser::Lite instead. This would mean reading the socket yourself and passing the markup to the parser in chunks as you read it. The interface is (as the name suggests) like a cut down version of the XML::Parser interface, but it uses pure perl and regexes to do th parsing which should mena that you would have a lot more control over the process.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller