News for hackers. Stuff that matters.
Re:Copying data is wasteful, mutating data is dangerous by oefrha on Thursday January 09, 2020 @12:53PM (#22003586)
Alas, CPython isn’t an optimizing compiler, it faithfully compiles code into bytecode which is then faithfully executed.

I don’t know the state of NumPy on PyPy since I don’t use PyPy.

Re:Copying data is wasteful, mutating data is dangerous by anoncake on Thursday January 09, 2020 @03:20PM (#22005216)
It does have a peephole optimizer.
Re:Copying data is wasteful, mutating data is dangerous by masklinn on Thursday January 09, 2020 @01:05PM (#22003701)
numba.jit might be able to optimise the extra copies away though, I'm reasonably sure working with numpy arrays is a pretty significant use case.
Re:Copying data is wasteful, mutating data is dangerous by ben509 on Friday January 10, 2020 @01:22AM (#22008765)
There's another project, Pythran, that does that.

I'm not sure if it's doing inlining before the laziness analysis, which would be ideal.

[1]: https://pythran.readthedocs.io/en/latest/INTERNAL.html#lazyn...