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

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Mar 14 23:05:27 UTC 2007


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



More information about the Pyrex mailing list