Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #31026] Fix generation of src/nci.c to be more efficient

7 views
Skip to first unread message

Dan Sugalski

unread,
Aug 9, 2004, 2:36:30 PM8/9/04
to bugs-bi...@rt.perl.org
# New Ticket Created by Dan Sugalski
# Please include the string: [perl #31026]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=31026 >


Right now the master function in nci.c that figures out if we have a
thunking function for a given function signature does a linear search
looking for a match. This is pretty nasty and gets slower the more
functions are in the search list. What we should do is change the
code generator (as src/nci.c is generated) to build up a hash of
signatures with the corresponding function pointer for much faster
lookup.
--
Dan

--------------------------------------it's like this-------------------
Dan Sugalski even samurai
d...@sidhe.org have teddy bears and even
teddy bears get drunk

Chromatic

unread,
Aug 9, 2004, 2:57:35 PM8/9/04
to p6i
On Mon, 2004-08-09 at 11:36, Dan Sugalski wrote:

> Right now the master function in nci.c that figures out if we have a
> thunking function for a given function signature does a linear search
> looking for a match. This is pretty nasty and gets slower the more
> functions are in the search list. What we should do is change the
> code generator (as src/nci.c is generated) to build up a hash of
> signatures with the corresponding function pointer for much faster
> lookup.

Is there a particular hash lookup style you have in mind? If there's
something similar in the code already, I can copy, paste, and modify the
generator trivially.

-- c

Dan Sugalski

unread,
Aug 9, 2004, 3:11:53 PM8/9/04
to chromatic, p6i

You could look at what we do for class registration -- that code
might be similar. I don't think we've got too much at the C level
that messes around with parrot hashes yet, though.

0 new messages