← Back to team overview

kicad-developers team mailing list archive

Re: SVN revs greater than 1753 require bootst 1.36 or higher


On Sunday 10 May 2009, Dick Hollenbeck wrote:
> Has anyone verified that the C++ compiler is able to optimize
> this macro down to something concise?

I have not looked at *this* macro, but a few years ago I made 
some tests on various uses of STL (the C++ standard template 

I found that in all cases, gcc did a good job of optimizing for 
speed, and a not-so-good job at optimizing for size of the 
executable. I also found that the compiler often took a long 
time to do it.

I compared the vector class against C-style arrays and found 
that there was no speed penalty for using the vector class, even 
in speed-critical loops.

I found that the string class seems to always perform at least 
as good as C-style strings, in both speed and space.

The only downsides of using STL that I found are compile time 
and code size. Code size is bigger because the templates are 
expanded in line, not as called functions. This means there is 
a lot of duplication when a template is used often.

I also looked at the run time cost of exceptions, and found that 
when exceptions are not called, there is no run time cost, as 
compared to other methods of accomplishing the task. The 
compiler does generate extra code to handle the exceptions, 
including calling destructors and unrolling the stack, but it is 
only used when an exception is actually thrown.

I also looked at the run-time cost of virtual functions, and 
found that it always compares favorably to other ways of 
accomplishing the task.

I think my application (circuit simulation, Gnucap) is more 
critical on speed issues than anything in Kicad

My conclusion of all of this is that these features work well 
and should be used when they do what is needed.