Know of Substantial Apps Written in Python?

Fredrik Lundh fredrik at pythonware.com
Fri Apr 6 09:49:24 EDT 2001


Eugene Leitl wrote:
> Seriously, what is roughly the overhead of the Python glue
> if I have a scripted sequence of 1) grabbing a frame from /dev/video
> 2) doing some processing on it 3) displaying it.
>
> Assuming 1, 2, 3 is written in C (I guess displaying a canvass will
> involve some Python), is the overhead relevant?

why not try it?

import time

def test():
    func = abs # some trivial C function
    t0 = time.time()
    for i in range(1000000):
        func(0) # call C code to grab a frame
        func(0) # call C code to process it
        func(0) # call C code to display it
    print "overhead:", (time.time() - t0) / 1000, "ms per frame"

test()

on a 700 MHz box, this prints:

    overhead: 0.00413600003719 ms per frame

Cheers /F

<!-- (the eff-bot guide to) the standard python library:
http://www.pythonware.com/people/fredrik/librarybook.htm
-->





More information about the Python-list mailing list