Data-Oriented Programming in Python
moderndescartes.com
Data-Oriented Programming in Python
1–10 of 47 posts
Re: Data-Oriented Programming in Python
#2Re: Data-Oriented Programming in Python
#3This is a wonderfully technical article. I'd love to learn more about Python internals as a scientific coder.
Edit: maybe this one on Numpy may be more relevant: https://youtu.be/u2yvNw49AX4
Re: Data-Oriented Programming in Python
#4This is a wonderfully technical article. I'd love to learn more about Python internals as a scientific coder.
[0] https://docs.python.org/3/howto/descriptor.html [1] https://docs.python.org/3/library/collections.html [2] https://docs.python.org/3/
Re: Data-Oriented Programming in Python
#5Re: Data-Oriented Programming in Python
#6> >>> multiply_by_two = homogenous_array * 2
will be calculated most of the times using a BLAS library - whichever you are using (https://numpy.org/devdocs/user/building.html)
Re: Data-Oriented Programming in Python
#7But you can't wave your hands around and say compiler optimizations will fix performance problems - they can, but they're not magic, and the arrow in the proverbial knee for optimization passes are language semantics that make them impossible to realize (forcing the authors to either abandon the passes, or rely on things like dynamic deoptimization which is not free).
Re: Data-Oriented Programming in Python
#8Python + C modules = Speed
Nothing new here, move along.
Re: Data-Oriented Programming in Python
#9I'm curious how you would do data oriented programming in a language with no type system and no control over memory layout. And I guess the answer is "you can't, but JITs might exist someday that do it for you" But you can't wave your hands around and say compiler optimizations will fix performance problems - they can, but they're not magic, and the arrow in the proverbial knee for optimization passes are language se…
The resulting code is even more annoying to write than using a lower level language typed language in the first place, but ecosystem access sometimes makes up for it.
Hopefully tools like mypyc get better, letting well-typed python code with reasonable usage patterns be compiled to reasonably efficient native code.
Last time I used it I was pleased with the performance benefits but it couldn't even compile all files in a module to a single shared library, despite this being mentioned as possible (and recommended) in the docs. Maybe I was doing something wrong, but they don't answer their github issues often, alas.
Any little thing helps though, it's one thing for throwaway scripts to be inefficient, but applications? At a large scale it is a monstrous waste of time and literal energy.
Re: Data-Oriented Programming in Python
#10I'd like to plug riptables ( https://github.com/rtosholdings/riptable ), which is (more-or-less) a performance upgrade to pandas.