3 ms·
You certainly can accept that slowdown if the total program run-time remains within acceptable limits and the use of a rapid prototyping language reduces develo
by bshipp 4y ago
You certainly can accept that slowdown if the total program run-time remains within acceptable limits and the use of a rapid prototyping language reduces development time. There are times when doing computationally heavy, long-running processes where speed is important, but if the 1000x speedup is not noticeable to the user than is it really a good use of development time to convert that to a more optimized language?
As was said, profile, find user-impacting bottlenecks, and then optimize.
- winstonewert 4y agoI would note that the choice of programming language is a bit different. Projects are pretty much locked into that choice. You've got to decide upfront whether the trade off in a rapid prototyping language is good or not, not wait until you've written the project and then profile it.
- bshipp 4y agoCertainly, but Python is flexible enough that it readily works with other binaries. If a specific function is slowing down the whole project, an alternate implementation of that function in another language can smooth over that performance hurdle. The nice thing about Python is that it is quite happy interacting with C or go or Fortran libraries to do some of the heavy lifting.
- dragonwriter 4y ago> Projects are pretty much locked into that choice. But, they aren't. I mean, profile, identify critical components, and rewrite in C (or some other low-level language) for performance is a normal thing for most scripting languages. > You've got to decide upfront whether the trade off in a rapid prototyping language is good or not, not wait until you've written the project and then profile it. No, you absolutely don't.
- winstonewert 4y agoYes, it true, if you use Python you can rewrite portions in C to get improved performance. But my point was rather that you couldn't later decide you should have written the entire project in another language like Rust or C++ or Java or Go. You've got the make decision about your primary language up-front. Or to look at it another way: Python with C extensions is effectively another language. You have to consider it as an option along with Pure Python, Rust, Go, C++, Java, FORTRAN, or what have you. Each language has different trade-offs in development time vs performance.