Registered Member
|
Hi,
I have a boost-python program. If I do #include <eigen2/Eigen/Core> In the main source file, but without using anything of again at any place, the program is slowed down by a factor of 2 ... Anyone knows why? Can this be circumvented? Thanks! Nathan |
Registered Member
|
Do you mean that the compilation takes twice longer? That is normal, you could ease this with precompiled headers.
Or that the execution of the program itself is slower? That would not be normal. What Eigen version? Can you dump Eigen symbol tables,
with and without including Eigen? Can you profile your program to determine where it's spending time? |
Registered Member
|
Hi,
No, I am not talking about compile time. The actual run time increases. I am compiling with "-O2 -g". For both (with and without Eigen), the output of nm -C your_program | grep Eigen is empty. Since it is a boost_python program, I can not (or at least do not know how) profile this program directly. I will write a C++ one and see what I can find out. Regards, Nathan |
Registered Member
|
This is crazy... I can't understand what is going on. The fact that there are no Eigen symbols pretty much proves that it can't be spending time in Eigen code...
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
Hi,
OK, it the differences in the profiling output I see: exp also calls fsetenv, fholdexcept and fsetround. In the version with eigen included. Could it be that eigen somehow redefines the exp function? If yes, Can this be avoided? Thanks! nathan |
Registered Member
|
I just checked:
That is a method in class Cwise, not the global exp() or std::exp(). So the answer is no, we don't redefine exp() or std::exp().
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
From the function names that you cite, it looks like something is something to play with floating-point exceptions. Like setting a FP exception handler, or something like that. Eigen doesn't do anything in that area.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
OK, this is most strange!
I use exp a lot in my program. - When I include math.h and use exp, the runtime is ~1 second - When I include cmath and use std::exp, the runtime is ~4 second - When I include math.h, use exp AND include eigen, the runtime is ~4 seonds If find this extremly strange. Anyone any idea? Thanks! Nathan |
Registered Member
|
And I found out another thing:
It is not including eigen, it is including cmath which triggers the problem. You might be right with FP exception handlers ... So eigen has nothing to do with it. Thanks for the help! Nathan |
Registered Member
|
I wonder if this could indirectly be related to c++ exceptions. Have you tried compiling with c++ exceptions disabled? -fno-exceptions
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
Hey,
Good idea, I tried that. But no, did not change a thing. |
Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]