OT: This Swift thing

Chris Angelico rosuav at gmail.com
Thu Jun 5 16:18:23 EDT 2014


On Fri, Jun 6, 2014 at 6:07 AM, Alain Ketterlin
<alain at dpt-info.u-strasbg.fr> wrote:
>> Perhaps, perhaps not. My experience is that only a small percentage of
>> the CPU time is spent in the Python interpreter.
>
> Basically, you're saying that a major fraction of python programs is
> written in another language. An interesting argument...

No, a major fraction of Python program execution time is deep inside
code written in another language. In extreme cases, you might have a
tiny bit of Python glue and the bulk of your code is actually, say,
FORTRAN - such as a hefty numpy number crunch - which lets you take
advantage of multiple cores, since there's no Python code running most
of the time.

And that's counting only CPU time. If you count wall time, your
typical Python program spends most of its time deep inside kernel API
calls, waiting for the user or I/O or something.

ChrisA



More information about the Python-list mailing list