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

2015-08-23 Thread Steven D'Aprano
On Sun, 23 Aug 2015 04:10 pm, Yuzhi Xu wrote: I find out that python's VM seems to be very unfriendly with CPU-Cache. Possibly. More comments below. for example: *** import time a = range(500) sum(a) for i in range(100): #just to create a

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

2015-08-23 Thread Vladimir Ignatov
Hi, for i in range(100): #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: range(100): _take_ memory. Additionally it will trigger garbage collecting

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

2015-08-23 Thread Yuzhi Xu
I find out that python's VM seems to be very unfriendly with CPU-Cache. see: http://stackoverflow.com/questions/32163585/how-to-handle-cpu-cache-in-python-or-fastest-way-to-call-a-function-once

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

2015-08-23 Thread Stefan Behnel
Yuzhi Xu schrieb am 23.08.2015 um 08:10: I find out that python's VM seems to be very unfriendly with CPU-Cache. see: http://stackoverflow.com/questions/32163585/how-to-handle-cpu-cache-in-python-or-fastest-way-to-call-a-function-once

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

2015-08-23 Thread Steven D'Aprano
On Sun, 23 Aug 2015 10:07 pm, Vladimir Ignatov wrote: Hi, for i in range(100): #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: range(100):