Re: [eigen] what do you think of this simple benchmark

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


2009/1/4 Matthias Pospiech <matthias.pospiech@xxxxxx>:
> The simple matrix class can be seen here:
> http://www.c-plusplus.de/forum/viewtopic-var-t-is-230960.html
> (comments welcome).

Your matrix is stored as a vector<vector>. That's not optimal. For
example, since each vector needs to store its size, the size is
getting stored n times for a n*n matrix... With a good STL
implementation, for large sizes, it may be asymptotically as fast as a
plain C array (like Eigen uses) but for small sizes you're going to
get a big overhead.

Your matrix is dynamic-size (as std::vector is, i.e. size is a runtime
variable), but in your benchmark below you compare it against Eigen's
fixed-size Matrix4f. Fixed-size matrices go much faster than dynamic
size ones...

Other than that, nothing special to say... remember to use gcc 4.2 or
newer -O2 -DNDEBUG for benchmarking Eigen, that's all.

Cheers,
Benoit

---


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