← Back to team overview

kicad-developers team mailing list archive

Re: Optimization

 

On Tue, Apr 26, 2016 at 11:07:52AM -0400, Chris Pavlina wrote:
> These are very, very small numbers. Honestly, is it worth the added code
> complexity? The added chance of bugs? (None here that I can see, but it's a
> risk we take every time we allow something like that). For a 3% improvement in
> some code that represents a quite small fraction of KiCad's total CPU time.

It's back from the old times when we had sine tables (no, really! we had them!)

First guess is that in modern CPUs pipelining, branch prediction and
cache locality have a bigger effect than raw computation.

For example on a DSP I'd never optimize a multiply with something else :P

In another project I even noticed that just adding a 'cached' valued in
a struct was slower than recomputing it each time; on the net I remember
a PS3 paper saying something like 'it's a game, it's not a computer
science assigment... put everything in a big array and feed it to the
GPU' :D

OTOH, even if we are not counting CPU cycles in an interrupt routine, since
in pcbnew 90 degrees multiples are arguably the common case you should
consider the net improvement (or worsening...)

In my experience anyway the big optimizations come from new data
structures and/or algorithms...

--
Lorenzo Marcantonio
CZ Srl - Parma

Attachment: signature.asc
Description: PGP signature


Follow ups

References