Re: [eigen] a few things

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi Christian, Ben, Ramon,

thanks a lot for your answers

On Thursday 10 January 2008 21:13:13 ollupaC De La Pradera wrote:
> However, I'm not sure if "static -const- int" is not enough for the
> compiler to optimize it over, have you checked it?

Yes, that's what we currently do in Eigen (for instance in alpha2).

> (Sorry, my "artistic" name confused you, my real name is Ramon)
> Ramon

Ah OK, I was not too sure. So your full name is... Ramon De La Pradera ?
Please edit the TODO to put your full name; I think that anyone can register 
at techbase.kde.org, AFAIK you don't need a KDE SVN account.

Ben wrote:
> I think that the static const ints are unnecessarily stored in data segment
> of the compiled program. It would be good to check the size difference of
> the executables before you revert back to static const ints.

Good idea. I checked the executables created for "benchmark" with 
g++-4.2 -O3 -DNDEBUG. They have the same size byte for byte.

Christian wrote:
> A static variable has to be somewhere as other objects might access it.
> But it's only created once. It might stop compilers from optimizing
> things away (that GCC and ICC do work doesn't say that it works for all
> compilers...)

Yes, I completely agree. So I conclude that I should go ahead with enums, even 
if it doesn't bring any improvement for the particular compilers we are 
using.

> We are using C++ here, so please avoid all #define (as far as possible...)

I agree. I only used #defines here to make absolutely sure that the absence of 
performance improvement was not caused by const ints being unoptimized. Now 
that I see it makes no difference, i'll go back to const ints.

OK, thanks a lot for your advice, you all.

Cheers,

Benoit

Attachment: signature.asc
Description: This is a digitally signed message part.



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/