Registered Member
|
Hi,
I really appreciate Eigen and your effor very much. Recently, when I tested hard realtime control application using Eigen, I found out something which I think is very strange. (Just for your information, the compil;er is MS Visual Studio 2010 running RTX2012 on MS Windows 7) The speed of assigning the vector elements is much slower when I use, e.g. q << 1.0, 0.1, 2.5, ......; for the (statically assigned) vector. e.g. Eigen::Matrix<double, 16, 1> q; This is very trivial assignment so I didn't think the bottleneck of realtime computation happened there. But, in debugging the code, it is really slow. So, I changed the code to q[0] = 1.0; q[1] = 0.1; ... Then, I gained realtime performance. What is the difference? Is there any other options to accelerate the speed? Then, shouldn't I use such assignement operation in hard realtime computation? I love this assignment operation very much. |
Moderator
|
In debug mode this operator add a significant overhead. With optimization ON, both methods produces very similar ASM and performance, at least with gcc. Perhaps MSVC still fails to inline a few functions. Looking at the generate ASM should help fixing the issue by forcing inlining of the problematic function. But first make sure you benchmarked in release mode.
|
Registered Member
|
Thanks.
First let me follow your hint, and if I get some result, I'll post again. |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]