|
|
|
|
|
by cyphar
3792 days ago
|
|
When I'm doing data analysis for my research project, I use Python (even though I mostly program in C, Go and handful of other languages) because all of the important performance stuff (fast Fourier transforms, literally all of numpy) are done in C with on-the-metal performance. Why should I have to worry about my memory allocation when I'm trying to do a bunch of statistical tests on data? Not to mention that I can do endless monkeypatching in Python safely, while in C you'd be trying to modify code (which modern kernels don't like). Most performance problems come from bad algorithms, not your programming language. I had a piece of code that had to do some complicated "image" masking with a 2 array, with feathering and some quite complicated statistical modelling to compute the offset. It took 20 minutes to run on a medium-sized data set. After sitting down with it for a few hours, I got it down to 30 seconds. If I switched it to C, it would've taken far too long to improve the performance. Python runs in a fairly well optimised VM anyway, so it's definitely "good enough". The source is on my GitHub, but it probably won't be useful to anyone: https://github.com/cyphar/keplerk2-halo. |
|