[Expat-discuss] Performance tuning of character data callbacks....

Kevin Burton burton at tailrank.com
Fri Aug 1 03:52:46 CEST 2008


Hey guys.
How do I increase the size of the buffer used with character data callbacks?

Looks like this is XML_CONTENT_BYTES by my 15 minutes of groking the source
which defaults to 1024.... I might bump this up to 16-32k.

.....

I'm debugging the use of PHP's integration of Expat for parsing of large
documents.

Looks like there are two problems that I can see.......

In this case, parsing a 500k XML document takes expat about 200ms..... which
is fast.

The problem is that php adds an extra 600ms to handle callbacks.

Simply calling empty methods adds another 300ms and using string concat in
php adds another 300ms on top of that.

I think can be reduced by increasing the chunk size of character data which
would both reduce the number of callbacks and reduce the number of string
concats needed by my application.

Kevin

-- 
Founder/CEO Tailrank.com
Location: San Francisco, CA
AIM/YIM: sfburtonator
Skype: burtonator
Work: http://spinn3r.com and http://tailrank.com
Blog: http://feedblog.org
Fax: 1-415-358-4198 PIN: 0092


More information about the Expat-discuss mailing list