On Thu, Mar 30, 2006 at 03:51:06PM +0100, Daniel P. Berrange wrote: > When processing the header of HTTP responses from Xend, libvirt currently > reads data a single byte at a time. Since its using lowlevel UNIX read() > function there is no buffering, which results in a large number of system > calls. The attached patch re-factors the code so that it reads data in > 4k chunks whenever possible. Since most rsponses are < 4k in size processing > the response now only takes two read() syscalls, rather than several hundred. Right, good optimization ! Applied, I just reindented and cleaned a bit, it's commited in CVS, thanks a lot ! > Of course most (90%) of the CPU overhead is still on the Xend/XenStored > end of the channel, but that's out of our control until the XML-RPC API > comes along. There is a awful lot of things that can be done to optimize, like keeping the connection alive, trying to do minimal caching,that we really didn't try to address yet. At this point this is more about functionalities than getting optimal, but this will come :-) Daniel -- Daniel Veillard | Red Hat http://redhat.com/ veillard@xxxxxxxxxx | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/