[Numpy-discussion] Re: overhead of numpy scalars

2022-06-02 Thread Pieter Eendebak
Hi, A small update on the scalar and small array performance: with a series of recent PRs performance has improved: Before: 1.0878291579974757 (numpy scalar) 0.511536967245 (numpy array of size 1) factor 2.13 faster Current: 0.6275881889996526 (numpy scalar) 0.436217111433 (numpy array

[Numpy-discussion] Re: overhead of numpy scalars

2022-05-04 Thread Sebastian Berg
On Tue, 2022-05-03 at 15:06 +0200, Pieter Eendebak wrote: > Hi everyone, > > Operations such as np.sqrt or np.cos on numpy scalars are much slower > than > operations on an array of size 1 (benchmark below). The reason seems > to be > that a numpy scalar (e.g. np.float64(1.1)) is converted interna