[Pyrex] python dictionaries with unsigned long long keys and values

Sam Tannous stannous at gmail.com
Thu Mar 15 15:03:44 UTC 2007


Thanks...

In that case, I can try to convert to using lists
(as much as I hate to stop using dictionaries...
guess I can't have simplicity & speed :-(

For speed, where (and how) should one create these
lists of unsigned long longs?  Just use Numeric?

Regards,
Sam

On 3/14/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
>
> Sam Tannous wrote:
> > From what
> > I can gather, any access to a dictionary (whether created in python or
> pyrex
> > code) slows everything down to pure python speeds.
>
> That's correct. You can gain some speed by using
> various PyDict_* functions directly, but all the
> keys and values still have to be Python objects,
> so there's a limit to what you can achieve.
>
> If you need a blazingly fast mapping from
> integers to integers, a Python dictionary just
> isn't going to give it. You'll have to implement
> your own C-level data structure.
>
> --
> Greg
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.copyleft.no/pipermail/pyrex/attachments/20070315/2e956fad/attachment.html 


More information about the Pyrex mailing list