On Mon, Feb 24, 2003 at 11:38:29AM +0100, [EMAIL PROTECTED] wrote:
> I was wondering what the fastest way of caching data was in Python?

Python Lists and Dictionaries are very fast, being 100% coded in C and
avoiding all of Python's function call overhead.

> so I can find stuff by getting:
> (tick is position in midi-ticks, note is, well, note, like E5, just in
> numbers)
> 
> cache[track][note][(tick/250)*250][tick]
> 
> I hope you can follow me and would be most gratefull for a reply.

I'm not sure about the (tick/250)*250 part, since it seems to be
redundant with indexing by tick. Apart from that, no, I don't see a
better way to optimize that off the top of my head. Are you having a
performance problem?

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to