WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

Re: [Xen-API] Xen-API C Bindings, version 0.4.1

To: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Subject: Re: [Xen-API] Xen-API C Bindings, version 0.4.1
From: Daniel Veillard <veillard@xxxxxxxxxx>
Date: Tue, 8 Aug 2006 18:01:35 -0400
Cc: Xen-API <xen-api@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 08 Aug 2006 15:01:49 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20060808210652.GB7498@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <20060808160023.GD28097@xxxxxxxxxxxxxxxxxxxxxx> <20060808191107.GD16710@xxxxxxxxxx> <20060808200647.GI2899@xxxxxxxxxx> <20060808210652.GB7498@xxxxxxxxxxxxxxxxxxxxxx>
Reply-to: veillard@xxxxxxxxxx
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.1i
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