← Back to team overview

kicad-developers team mailing list archive

Re: Strange COLOR4D::LegacyMix( COLOR4D aColor ) optimization

 

Hi JP,

You could well be right, I did not perform cycle counting on this method,
just kept the map lookup because that is what was used before.  It would be
a better optimization (if one if even needed) to come up with a fast way of
hashing a COLOR4D so that it can be used as a key in a key-value store.
Please feel free to change how this works, I am not attached to it.

Best,
Jon

On Thu, Feb 23, 2017 at 10:24 AM, jp charras <jp.charras@xxxxxxxxxx> wrote:

> Hi Jon,
>
> When searching a fix to an issue in legacy mode (incorrect calculation of
> ORed wxColors), I had a
> look at
> COLOR4D::LegacyMix( COLOR4D aColor )
>
> and for me the optimization to calculate the mix between 2 wxColors need
> more calculation than the
> basic calculation.
> optimization: normalize and convert 8 double to int, search in map and
> normalize 4 int to double
> direct calculation (faster):
> normalize and convert 6 double to int, and normalize 3 int to double.
>
> Am I missed something?
>
> Thanks.
>
> --
> Jean-Pierre CHARRAS
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>

Follow ups

References