Re:Make your programs run faster by better using the data ca...
by carlmr on Saturday June 24, 2023 @03:40AM
(#36456481)
Exactly my thought. Whenever I see wild optimization goose chases it's Python causing all the issues.
The problem is that a lot is still possible to optimize "in Python" although as you say the code becomes less and less readable to your average Python developer, so that people don't notice they just picked the wrong tool for the job.
You need more speed? Use multiprocessing? Allocate memory appropriately? Rust, or if you like pain, C or C++.
Re:Make your programs run faster by better using the data ca...
by Etherlord87 on Saturday June 24, 2023 @03:41AM
(#36456487)
You need to tell that to the authors TensorFlow.
Re:Make your programs run faster by better using the data ca...
by pzo on Saturday June 24, 2023 @04:13AM
(#36456635)
Doesn't Tensorflow has C++ API? I think tensorflow and pytorch under the hood using c++/c. Tensorflow has even official Rust bindings. The same applies to libraries like Open3d and OpenCV - although mostly people consume their python API under the hood is very optimized C++ code parallelized for many CPU and SIMD instructions.
Use the right tool for the job.
Your entire journey here is battling with Python and not the problem space. Your improvements are solely measured by how your code leaves Python problem solving space, so you end up writing what's probably unpythonic and unmaintainable Python.
Why?
Rewrite in Go, Rust or C++ or whatever.
If you need to go faster than Python, don't use Python. Python is great for everything else. Its overhead and sluggish execution are consequences of its greatest strength.