3 ms·
>This still misses the point. If the goal was always to produce a fast program because the end user wanted speed, then why were you ever writing that pure Pytho
by coldtea 9y ago
>This still misses the point. If the goal was always to produce a fast program because the end user wanted speed, then why were you ever writing that pure Python version to start with?
Tons of reasons. Some companies will opt for what's fashionable -- e.g. Electron SPA's today. Or with what's cheaper to churn out. Or have their users locked in and could not care less, just use what's cheapest and fastest to get something out.
- mlthoughts2018 9y agoSure, but for the purposes of a blog post that’s supposed to shine a light on performance considerations in specific, contrived examples, it would be a strawman. Yet that’s the setting where you see a lot of people write e.g. a naive double loop algorithm in Python and criticize its performance compared with “the same” double loop algorithm in C. It’s an uninformative comparison precisely because they are not “the same.” Pure Python looping (iterators) and doing pure Python operations in the loop body (run time type dynamics implicitly assumed to be needed/desired, heterogeneous container types of PyObject references assumed to be needed/desired) is conceptually a different thing than loops in C (simple increments) and, say, operations on a contiguous memory array, regardless of whether the syntax looks superficially similar to invite a visual comparison.