g-wrap-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fwd: Re: First look at new g-wrap -- it's slow!]


From: Andy Wingo
Subject: Re: [Fwd: Re: First look at new g-wrap -- it's slow!]
Date: Wed, 19 May 2004 09:40:36 +0100

Hey,

On Wed, 2004-05-12 at 16:19 +0200, Andreas Rottmann wrote:
> Andy Wingo <address@hidden> writes:
> 
> > Takes care of depends-on! and the dual namespaces in one step. No more
> > registry. Or if you don't like lists or quasi-quote you could do it like
> > define-module does, with `#:use-wrapset <foo> #:use-wrapset <bar>' or
> > something.
> >
> I think class arguments are resolved at definition time, so you'd get
> 'undefined symbol <foo>', I think.

Yes they are, but if you (use-modules) for all the wrapsets you depend
on (which you have to anyway), they should be defined.

>  The registry however serves some other purposes:
> 
> 1) Assign a unique symbol to each wrapset independently of the class
>    name; this is used e.g. for the name of the shared library.

This information can be associated with the class itself, i.e. on a
slot.

> 2) Instanciate a given wrapset just once; e.g. when one has wrapsets
>    A, B and C, both B and C depend on A. When you now create wrappers
>    for B and C from the same program, A will only be instanciated
>    once, instead of twice. I know we don't use this yet (only one
>    wrapset generated by per guile invocation), but it might come handy
>    performance-wise.

This is surely premature optimization. Even if you needed it, you could
have make-instance specialized for wrapsets to memoize the return value.

It's not fatal or anything, but it's not very schemey to have multiple
namespaces.

> > Another C issue: Why do functions need any prefix other than _wrapper?
> >
> You mean why wrapper functions are named gw__tmpXXX_FOOBAR_wrapper?
> Why do yu have a problem with that?

Well, I thought it was less readable. That's less of a problem now
because there are less wrapper functions in the g-wrap files now.  But I
changed my mind on this issue, because of the DSO symbol tables
mentioned by Ulrich Drepper in his paper, "How to write shared
libraries". In short, making symbols unique in the first few characters
makes collision resolution faster for the symbol hash tables. I think
this is what James Henestridge was referring to a few months ago in his
blog about not naming functions well.

-- 
Andy Wingo <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]