[Ktechlab-devel] profiling is adictive.

P Zoltan zoltan.padrah at gmail.com
Wed Feb 18 23:20:11 UTC 2009


On Wed, 18 Feb 2009 03:45:56 +0100, Alan Grimes <agrimes at speakeasy.net>  
wrote:

> Take my advice, don't get started on profiling and optimization unless
> you have several days worth of time to waste. =P

  But don't forget:

  "The First Rule of Program Optimization: Don't do it. The Second Rule of  
Program Optimization (for experts only!): Don't do it yet.” - Michael A.  
Jackson" (  
http://en.wikipedia.org/wiki/Optimization_(computer_science)#Quotes )

  In my opinion the most important quality of the code is to be easily (1)  
maintainable, (2) reliable and (3) fast. So don't optimize if (1) and (2)  
are not fulfilled.


>
> The biggest CPU sucker in ktechlab is the linear algebra engine. The
> reason it gets called so much is that non-linear things such as
> transistors need to iterate in order to converge on their instantaneous
> DC conditions... I found several ways to reduce the number of times
> QMatrix[] is called...

  What about allowing to user to tune / relax convergence error conditions.  
Precision vs CPU time balance? :)

> GCC doesn't seem to be inlining it, that could
> also be a fairly substantial boost. The biggest gain was to convert a
> copy (double) loop into a memcpy, that was a very substantial gain!

  For debug builds, I'd have let there that loops. But still.. was that  
copy operation needed at all? :P




More information about the Ktechlab-devel mailing list