4 ms·
This is premature optimization right
by VWWHFSfQ 5y ago
This is premature optimization right
- simonh 5y agoIt's not always the sin it's made out to be. It's a matter of risk and cost. If there's a high risk performance will be an issue, and optimising later will have a high cost (or optimising early has a low cost), then it makes sense.
- adgjlsfhk1 5y agoYes and no. One of the biggest disadvantages of python is that the way people typically optimize python code is to 1. rewrite in numpy 2. rewrite in Cython (or other python compiler) 3. rewrite in C++ The problem with this workflow is that it means you end up rewriting large chunks of your code over several years in systems that have fairly different idioms. If you suspect you might in the future be performance bottle-necked, writing your code in a faster (but still productive) language to start can be a lot better because you can then improve performance more incrementally without multiple full rewrites.
- pharmakom 5y agoI don’t believe so. Choosing a language that is faster (and still productive) from the get-go has almost no cost but reduces the risk of rewrite.