114
you are viewing a single comment's thread
view the rest of the comments
[-] Womble@lemmy.world 5 points 3 months ago

Nope, if you're working on large arrays of data you can get significant speed ups using well optimised BLAS functions that are vectorised (numpy) which beats out simply written c++ operating on each array element in turn. There's also Numba which uses LLVM to jit compile a subset of python to get compiled performance, though I didnt go to that in this case.

You could link the BLAS libraries to c++ but its significantly more work than just importing numpy from python.

[-] FizzyOrange@programming.dev 0 points 3 months ago

numpy

Numpy is written in C.

Numba

Numba is interesting... But a) it can already do multithreading so this change makes little difference, and b) it's still not going to be as fast as C++ (obviously we don't count the GPU backend).

[-] HyperCube@kbin.run 1 points 3 months ago

Numpy is written in C.

So you get the best of both worlds then: the speed of C and the ease of use of Python.

[-] FizzyOrange@programming.dev 3 points 3 months ago

Sure but that's not relevant to the current discussion. The point is that removing the GIL doesn't affect Numpy because Numpy is written in C.

load more comments (3 replies)
load more comments (3 replies)
this post was submitted on 13 Jul 2024
114 points (98.3% liked)

Programming

17242 readers
269 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS