[Insight-developers] Empty FixedArray destructor: Performance hit using gcc (times 2) : __attribute__ ((aligned (8)))

Luis Ibanez luis.ibanez at kitware.com
Fri Jun 6 11:43:57 EDT 2008


Brad,

Now that you mention the non-trivial destructors...

Boost has specific traits for them.

boost::has_trivial_destructor
http://synopsis.fresco.org/boost/Scopes/boost/has_trivial_destructor.html

There is also an interesting discussion on alignment:
http://www.boost.org/doc/libs/1_34_1/libs/pool/doc/implementation/alignment.html


Maybe we can search their site for wisdom...


    Luis

------------------------
Bradley Lowekamp wrote:
> My guess as to why the empty destructor effects alignment has to do with 
> the way the compiler handles trivial verses non-trivial destructors. I 
> think removing the destructor just to effect alignment and performance 
> is akin to swapping the order of lines of code to get better 
> performance. Line swapping can make a surprising difference, but it's 
> also waisted effort because it will break on a different version of the 
> compiler. I vote for the compiler macros.
> 
> 
> On Jun 6, 2008, at 10:23 AM, Tom Vercauteren wrote:
> 
>> Hi Luis,
>> Well I would really vote for removing the empty destructor
>> implementation. This seems to be the cleanest way to solve the
>> problem. The empty destructor is useless and only interferes here. I
>> don't really like changing compilation flags or adding macros and
>> adding a new derived class would be confusing for the user.
>>
>> Tom
>>
> 
> 
> Bradley Lowekamp  
> 
> Lockheed Martin Contractor for
> 
> Office of High Performance Computing and Communications
> 
> National Library of Medicine 
> 
> blowekamp at mail.nih.gov <mailto:blowekamp at mail.nih.gov>
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers


More information about the Insight-developers mailing list