[Numpy-discussion] Re: call for contributions – content writers for the NumPy newsletter

2022-01-19 Thread rajasekaran86
Hello Mrs. Inessa, Thanks for guiding me on contributing to the technical documentation of Numpy.I will go through the Github repo and look upon issues and try to solve them. Thanks again. Yours friendly, K.Rajasekaran __

[Numpy-discussion] Re: Performance mystery

2022-01-19 Thread Sebastian Berg
On Wed, 2022-01-19 at 20:49 +0100, Jerome Kieffer wrote: > On Wed, 19 Jan 2022 19:48:32 +0100 > Francesc Alted wrote: > > > What puzzles me is that the timeit loops access `z` data 3*1 > > times, which is plenty of time for doing the allocation (just > > should > > require just a single itera

[Numpy-discussion] Re: Performance mystery

2022-01-19 Thread Sebastian Berg
On Wed, 2022-01-19 at 19:48 +0100, Francesc Alted wrote: > On Wed, Jan 19, 2022 at 6:58 PM Stanley Seibert > > wrote: > > > Given that this seems to be Linux only, is this related to how > > glibc does > > large allocations (>128kB) using mmap()? > > > > https://stackoverflow.com/a/33131385 > >

[Numpy-discussion] Re: Performance mystery

2022-01-19 Thread Jerome Kieffer
On Wed, 19 Jan 2022 19:48:32 +0100 Francesc Alted wrote: > What puzzles me is that the timeit loops access `z` data 3*1 > 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 c

[Numpy-discussion] Re: Performance mystery

2022-01-19 Thread Francesc Alted
On Wed, Jan 19, 2022 at 6:58 PM Stanley Seibert wrote: > Given that this seems to be Linux only, is this related to how glibc does > large allocations (>128kB) using mmap()? > > https://stackoverflow.com/a/33131385 > That's a good point. As MMAP_THRESHOLD is 128 KB, and the size of `z` is almost

[Numpy-discussion] Re: Performance mystery

2022-01-19 Thread Sebastian Berg
On Wed, 2022-01-19 at 11:49 +0100, Francesc Alted wrote: > On Wed, Jan 19, 2022 at 7:33 AM Stefan van der Walt > > wrote: > > > On Tue, Jan 18, 2022, at 21:55, Warren Weckesser wrote: > > > expr = 'z.real**2 + z.imag**2' > > > > > > z = generate_sample(n, rng) > > > > 🤔 If I duplicate the `z =

[Numpy-discussion] Re: Performance mystery

2022-01-19 Thread Andras Deak
On Wed, Jan 19, 2022 at 11:50 AM Francesc Alted wrote: > > > On Wed, Jan 19, 2022 at 7:33 AM Stefan van der Walt > wrote: > >> On Tue, Jan 18, 2022, at 21:55, Warren Weckesser wrote: >> > expr = 'z.real**2 + z.imag**2' >> > >> > z = generate_sample(n, rng) >> >> 🤔 If I duplicate the `z = ...` li

[Numpy-discussion] Re: Performance mystery

2022-01-19 Thread Francesc Alted
On Wed, Jan 19, 2022 at 7:33 AM Stefan van der Walt wrote: > On Tue, Jan 18, 2022, at 21:55, Warren Weckesser wrote: > > expr = 'z.real**2 + z.imag**2' > > > > z = generate_sample(n, rng) > > 🤔 If I duplicate the `z = ...` line, I get the fast result throughout. > If, however, I use `generate_sam

[Numpy-discussion] Re: advice for using datetime64 in C binding

2022-01-19 Thread Benoit Gschwind
Hello Sebastian, Thanks for the precision Best regards On Tue, 2022-01-18 at 11:52 -0600, Sebastian Berg wrote: > On Tue, 2022-01-18 at 18:29 +0100, Benoit Gschwind wrote: > > Hello Sebastian, > > > > Thanks for detail. > > > > The last call has the NPY_ARRAY_C_CONTIGUOUS and NPY_ARRAY_ALIGNE