2 Sep 2009 19:01
Re: [Cython] FW: cython and hash tables / dictionary
On Wednesday 02 September 2009 18:01:43 Robert Bradshaw wrote: > On Sep 2, 2009, at 5:34 AM, Sanne Korzec wrote: > > Hi mailing, > > > > I’ve been writing a complex program in python, which I am currently > > scaling up. I find myself in the position now, where I run out of > > memory or out of time. I have been looking at alternatives like > > cython and ctypes. I implemented ctypes which fixes the memory > > problem but doubles the time problem. > > > > Currently I am implementing a cython version and ran into a > > problem. I hope someone can help me out. > > > > The main bottleneck in my code is a large dictionary / hash table > > which I would like to optimize. Since a dictionary is a python > > datatype I have no idea how to make this cython. > > > > Currently I have tried to keep the ‘keys’ intact and store the > > ‘values’ as ctypes floats, but I think it might be better to do > > something else. Do I need to make the entire hash table c? Or is > > there a more simple solution like combining the python dict with > > cython? If so, how do I do this? > > > > Thanks in advance. > > > > Additional details: I use a double dict where the key of the first > > dict stores another dict as value. > > > > S. >(Continue reading)
RSS Feed