[Numpy-discussion] Re: Improved 2DFFT Approach

2024-03-05 Thread via NumPy-Discussion
Good evening, Ralf!

I beg your pardon, for some reason I didn't get the notification of your 
response to this issue and couldn't answer in a more timely fashion. 

We'll cover all the mentioned points in shortest time possible (also some 
university and job projects) and I really appreciate such a profound person as 
you are finding time reviewing our contribution. 

I'll contact you later on here on all the mentioned points with the results.

Thanks for you time, 

Regards,

Aleksandr
___
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


[Numpy-discussion] ENH: tobytes / frombuffer extension

2024-03-05 Thread Dom Grigonis
I suggest adding flag - `full: bool`

by default it is False. And if it is True, then it runs: 
https://github.com/numpy/numpy/blob/main/doc/neps/nep-0001-npy-format.rst

The whole point is that it should be implemented in C.

Currently:
```
def save(a):
 m = io.BytesIO()
 np.save(m, a)   # / np.lib.format.write_array
 return m

a = np.ones((1000, 100))

 %timeit save(a)
90.8 µs
%timeit a.tobytes()
37 µs
```

So... For extra few bytes performance decreases almost 3 times. Mostly due to 
copy operations. There are stack questions regarding this. Also, various 
libraries implementing custom types in messagepack and json serialisers, etc...

Such improvement would benefit performance and improve simplicity in various 
places.

Regards,
DG
___
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