5 ms·
If you need multi-core for performance, first you should rewrite in a compiled language instead of Python. Java/C/C++/Go/FORTRAN/whatever will run 10 to 20 time
by brianolson 10y ago
If you need multi-core for performance, first you should rewrite in a compiled language instead of Python. Java/C/C++/Go/FORTRAN/whatever will run 10 to 20 times faster before even worrying about running multi-core.
- kirkdouglas 10y agoPython is compiled language.
- corysama 10y agoThat is technically correct, but not useful for the conversation...
- jMyles 10y agoNo it's not. That's like (and I know this has been said again and again) that "War and Peace" is a hardcover book. It's a non-sequitur.
- jMyles 10y agoPython can be compiled, interpreted, or translated into smoke signals and reconstituted on the other side of the valley. It is not per se any of these things.
- corysama 10y agoOn a mid-range desktop PC, the horsepower breakdown is something like: 100% everything, 75% GPU, 25% all CPUs, 5% one CPU including SIMD, 1% a single CPU running scalar code. I love Python. But, it's good to remember sometimes that it runs at about 1% efficiency compared to well-optimized C. So, you paid for a whole machine and you are utilizing 0.01%. That's fine for a lot of tasks; especially tasks that are 99% I/O-bound or tasks that are just coordinating big C libraries to do 99% of the work. Just good to remember sometimes...
- noobiemcfoob 10y agoHedging around these statements is important, but far too often I see people convinced they are in the 1% of tasks that truly need top level performance. Which is to say, I often see people who are wrong.
- nine_k 10y agoIt is mostly done already, if you consider numpy. But the top-layer glue code, which is Python, needs to allow it to tun in parallel, where it's not automatic.
- mixmastamyk 10y agoSometimes you just need better performance, not necessarily blistering.
- mixmastamyk 10y agoScalable, I meant to add.