Whilst I'm at it, is there any advantage into turning the various lists into C arrays? I won't be accessing them from Python and thus was wondering if it would also be possible to speed up the __getattribute__ implementation in Namespace? Thanks!
Do you guys hang out on IRC at all? On Sun, Nov 9, 2008 at 3:56 AM, tav <[EMAIL PROTECTED]> wrote: > Hey all, > > Apologies if this is the wrong list to post to -- I couldn't find a > cython-users list... > > I've been using Cython to speed up instantiation of a Namespace object > written in Python: http://paste.lisp.org/display/69989 > > Fundamentally, what I am trying to do is: > > class Namespace: > def __init__(self, **env): > global id, store > id += 1 > keys = store[id] = sorted(env) > new_env = [] > for key in keys: > obj = env[key] > if PyFunction_Check(obj): > obj = staticmethod(obj) > new_env.append(obj) > self.env = new_env > > The sort() and looping (for key in keys) seems to take up most of the > time... how can I do this better so that it takes less time? > > The Cython version so far is at http://paste.lisp.org/display/69988 > > Please forgive my Cython newbie errors... Thanks! > > -- > love, tav > > plex:espians/tav | [EMAIL PROTECTED] | +44 (0) 7809 569 369 > -- love, tav plex:espians/tav | [EMAIL PROTECTED] | +44 (0) 7809 569 369 _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
