On Wed, 19 Jan 2022 19:48:32 +0100 Francesc Alted <fal...@gmail.com> wrote:
> What puzzles me is that the timeit loops access `z` data 3*10000 > times, which is plenty of time for doing the allocation (just should > require just a single iteration). Hi all, Very interesting discussion ... IIRC, timeit does some clever tricks like disabling the garbage collector, so for the first run of timeit, I suspect it does 10000 malloc (without associated free thus without the ability of recycling any of those buffers). On the second run, those buffer were allocated previously and kept by Python for re-use which could explain the faster run. This does not explain really the different between operating systems observed. Cheers, Jerome _______________________________________________ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-le...@python.org https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: arch...@mail-archive.com