discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Vectorized Python code overflows faster


From: Fons Adriaensen
Subject: Re: [Discuss-gnuradio] Vectorized Python code overflows faster
Date: Fri, 16 Jun 2017 19:57:15 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Jun 16, 2017 at 12:18:31PM -0700, Zach Morris wrote:

> In short, my "optimized" Python code seems to run faster in testing, but
> overflow more in practice. Could you help me understand why this happens?

This looks like a classical example of 'fast and efficient' not being the
same as 'real-time-safe'.

Assume you have some routine that is called every T seconds, and it must
complete its work and return before the next call is due or the caller
gets into problems. Then it is not sufficient that on average the routine
is fast enough - its *worst case* running time must be less than T.

And that is something that Python just can't guarantee. No matter how
fast your code is, any single call could take much more than the average
time, for example when  Python calls its garbage collection routines
which it can do at any time.

The classical solution for this is buffering.   

Ciao,

-- 
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]