Registered Member
|
I'm using the C++ Eigen header library, and I've got millions of largish VectorXd objects (10K elements) in a cache (an array). Then I'm trying to retrieve these vectors one at a time to be used in some computation.
Now, moving these large VectorXds in and out of the cache is expensive because it seems to induce copies, profiling using linux perf shows the program is spending a lot of time in:
So my intention is to just store the data in the cache once and later move around pointers instead of objects. However, when the final computation using the VectorXd is done, it requires an object not a pointer, and as I understand it dereferencing to a local object it will cause an copy (expensive again). Would it make sense to move around double pointers and only use Map to instantiate VectorXd objects just before I need the computation done, is Map an expensive operation? Any suggestions welcome. |
Moderator
|
Are you sure you benchmarked with optimization ON? (e.g., with -O2) It's weird that the _mm_store_pd intrinsic appears in the profiler.
Constructing a Map object is like a no-op. |
Registered Member
|
I'm compiling Eigen 3.2.0 using g++ 4.6.3 on 64-bit Ubuntu 12.04 for Intel Xeon:
I will try the Map approach. |
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]