FW: OverExecuting characterDataHandler()
"James Renton" <[email protected]> Wed, 10 Dec 2008 10:17:28 -0600 (CST)
| Newsgroups | gmane.text.xml.expat.general |
|---|---|
| Message-ID | <1228925848.v2.mailanyonewebmail-234616@fuse114> |
I am using expat to quickly extract and parse an audio stream encoded in base64. This way I can include all kinds of useful meta-data as attributes of each chunk. The source of my audio produces 8000 – 32000 bytes per second. I just produced a working prototype and noticed that calls to my characterDataHandler() (set by using XML_SetCharacterDataHandler()) are occurring as follows: 1. All bytes up to but excluding the first/next carriage return (in my case 80) 2. Carriage return (single byte) 3. Repeat (1) I am pushing this data off-process and streaming it to various endpoints using sockets (not decoding). This is producing a VERY LARGE quantity of function calls to my handler which is not optimum. It would be much better if at least 1-15 kilobytes of data were passed to the characterDataHandler at a time rather. My questions: 1. How exactly does the character data parsing in expat work? Some insight in this regard might answer all of my questions. 2. Is the behavior of the libraries calls to the handler configurable in any way (possibly using #define’s, custom builds etc…)? 3. Is there any other way to decrease the number of function calls in this case? I appreciate any feedback. Thank you, James Beverly, MA _______________________________________________ Expat-discuss mailing list [email protected] http://mail.libexpat.org/mailman/listinfo/expat-discuss