gpsd-dev
[Top][All Lists]
Advanced

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

Re: [gpsd-dev] [PATCH] Speed up gpsfake.


From: Eric S. Raymond
Subject: Re: [gpsd-dev] [PATCH] Speed up gpsfake.
Date: Thu, 17 May 2012 16:31:44 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

Beat Bolli <address@hidden>:
> Hi Terje
> 
> On 17.05.12 20:35, Terje Mathisen wrote:
> > The "count % 11" operation is _very_ expensive you know,

It's *Python*.  A test tool.  Micro-optimizing at this level makes no
sense - I prefer the clarity of the % operation.  Maintainability,
always think maintainability first. Machine-efficiency gains are
almost[*] never interesting; they get swamped by Moore's Law too quickly.

* Except in well-defined critical paths.

> At least I thought of using a reduction factor that has no common
> divisors with the number of baton states...

*That* property should have been documented.

    # By setting this > 1 we reduce the frequency of the twirl
    # and speed up test runs.  Should be relatively prime to the
    # nunber of baton states, otherwise it will cause beat artifacts
    # in the twirling.
    SPINNER_INTERVAL = 11

/me hopes both Terje and Beat will take a lesson here.
-- 
                <a href="http://www.catb.org/~esr/";>Eric S. Raymond</a>

Attachment: signature.asc
Description: Digital signature


reply via email to

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