2 Sep 2009 18:30
Re: [Cython] FW: cython and hash tables / dictionary
Sanne Korzec wrote: > The main bottleneck in my code is a large dictionary / hash table which > I would like to optimize. In what way do you need to optimize it? i.e. how is it used? do you have memory issues or speed issues? python dicts are highly optimized already, so you're not likely to do much better with the look-up speed. -Chris -- -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@...
Floating point and hashes
don't seem like a good idea.
(Just a note, I believe the OP was talking about floats in the values so
we're good.)
> (3) actually do the lookup
> (4) unwrap the result back into a float.
>
> Python does have a highly optimized (3), but the overhead for the rest
> will probably overwhelm it speedwise, so I bet a simple, unwrapped
> implementation would still be quite a win.
>
> - Robert
RSS Feed