how to handle cpu cache in python ( or fastest way to call a function once)

Vladimir Ignatov kmisoft at
Sun Aug 23 14:07:26 CEST 2015


>> for i in range(1000000): #just to create a time interval, seems this disturb cpu cache?
>>     pass

Python interpreter consumes memory quite extensively because
"everything is object".  So constructions like:


_take_ memory.  Additionally it will trigger garbage collecting code
on deallocation time so expect even more delay.
To get most out of Python - all "numbers crushing" / "pixel pushing" /
"store gigabytes" code should go to low-level compiled binary


More information about the Python-list mailing list