[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-API] Xen-API C Bindings, version 0.4.1
On Tue, Aug 08, 2006 at 10:06:52PM +0100, Ewan Mellor wrote: > On Tue, Aug 08, 2006 at 04:06:47PM -0400, Daniel Veillard wrote: > > When using XPath with constant string, there is a serious optimization > > consisting of compiling first the XPath, and then reusing the compiled > > XPath instead for the repetive queries. But it's probably a bit early for > > optimization. > > I'm doing this already, no? heh, right, I misread :-) > Or is there another optimisation that I don't > know about? If you can reuse the xmlXPathContext that could be non neglectible too but thread safety becomes a concern. Only one thread at a time can use it obviously. > > I agree with the other points raised by Dan. I will add another one, > > the use of enum within public structures and parameters or return of > > functions, this is a very weak point of C, you don't have a good garantee > > of allocation size, this may vary from one compiler to another, or > > if you grow the number of items in the enum, I would avoid that and > > use int (but document that it's supposed to be an enum), you loose a bit > > of typechecking by compiler but gain ABI stability. > > That's an interesting point. I thought that enums were defined to be the same > size as int, but looking around it seems more complicated than this! I have seen ABI breakage because the number of values grew up and the compiler decided to allocate more bytes, ouch ... 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/ _______________________________________________ xen-api mailing list xen-api@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |