Registered Member
|
I need to create a super large 2D float array of size width*height. However, the exact size (around 2million by 50) of the array is only known at runtime.
I compared simple C++ array with Eigen Matrix 1.
2.
I am using MSVC2008 with Win7. Under Debug mode, the performance of allocating such a HUGE matrix is similar, around 1.5 seconds. However, under release mode, Eigen is much much faster than C++ array. 0.05s vs 1s. Why is eigen so fast? Is it because of some special instruction used in Eigen? |
Moderator
|
In this particular case this is because we allocate a single chunk of memory and address the elements like this: data[i+j*nb_cols].
|
Registered Member
|
I see. Is this what is called "automatic vectorization"?
|
Moderator
|
Not at all. Automatic vectorization refers to the explicit uses of SSE (or similar) SIMD instructions.
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]