Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: XML::Parser Streams performing undesired buffering

by BrowserUk (Pope)
on Jun 19, 2003 at 19:43 UTC ( #267324=note: print w/replies, xml ) Need Help??


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


Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://267324]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2020-11-30 08:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?