News for hackers. Stuff that matters.
Re:SciPy 1.0: fundamental algorithms for scientific computin... by visarga on Tuesday February 11, 2020 @01:39AM (#22296566)
Well, you got to think about optimisation - loop unrolling, parallelisation on all available cores, efficient data layout that works well with caching, doing it on GPU, adapting to the type of GPU you have. It's not as easy as dumping three for loops.
Re:SciPy 1.0: fundamental algorithms for scientific computin... by enriquto on Tuesday February 11, 2020 @01:50AM (#22296601)
The fact that you write three nested loops on your program does not mean that the compiler/interpreter cannot do all these nifty things when running the code.
Re:SciPy 1.0: fundamental algorithms for scientific computin... by zo1 on Tuesday February 11, 2020 @06:30AM (#22297668)
You're talking about the wrong language, then. This is not c-python (or python too perhaps) if you want such ridiculous compiler-level optimizations. If you want the languages for loops to be almost on-par with the hyper-optimized implementations being utilized in numpy and the layers below it then you should use something like C++ and hand-roll those for-loops yourself.

The reason python is so amazing in this regard is because that has all been done for you on some level and you just need to use them. Sure, could the numpy/scipy interfaces into lower-level code be more closely aligned to plain for loop implementations of the algorithms they represent? Perhaps.

Re:SciPy 1.0: fundamental algorithms for scientific computin... by kmbriedis on Tuesday February 11, 2020 @01:58AM (#22296639)
As a side note - loop unrolling has almost no effect, it just allows scalar replacements for latency bound instructions and some other stuff