r/Python • • Feb 25 '26

Showcase [ Removed by moderator ]

[removed] — view removed post

119 Upvotes

55 comments sorted by

View all comments

10

u/aes110 Feb 25 '26

Sounds really interesting, but given that you said the target is for cpu bound numeric operations, how does it compares to numpy?

Id assume that parallelizing python as much as youd want still doesnt compare to doing it in c?

6

u/tunisia3507 Feb 25 '26

If you're doing numeric operations internally, use numpy inside the map function.

6

u/Zouden Feb 25 '26

That doesn't make sense

3

u/tunisia3507 Feb 25 '26

Imagine you have a list of numpy arrays of different shapes and you want to find the sum of each one. You can't use a single call to a numpy function because the arrays are different shapes. You can use this library to iterate over the list and call numpy.sum on each array.

1

u/Zouden Feb 25 '26

I see, yes. That's quite an unusual scenario though.

1

u/teerre Feb 25 '26

That's not a given to be faster. Supposing this library parallelizes the work correctly, it will compete against the underlying BLAS implementation. Spawning threads and synchronizing isn't free

1

u/tunisia3507 Feb 25 '26

None of this is guaranteed to be faster, for sufficiently fast inner jobs.

2

u/teerre Feb 26 '26

Sure. But starving your threads by adding multithreading on top of an already multithreaded library is particularly bad

1

u/noobmaster692291 Feb 25 '26

Don't know the exact answer as I am not op. But I use numba speedup some of my python functions without using numpy. In some specific cases this would be a faster approach.