Re: [eigen] what do you think of this simple benchmark |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] what do you think of this simple benchmark
- From: "Benoit Jacob" <jacob.benoit.1@xxxxxxxxx>
- Date: Sun, 4 Jan 2009 18:45:35 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=xxBMAANsWrJpUtCrlpyIU71/UWU1nqjSLbX8xuoG3/w=; b=J3JOa5hKmKcSSInVsOhxKhTNTqfoFZR++ekOoIzak6cifdwCuI8CN4vp04dG9eRq2y m3CXV5lZYWieEV9lwq1U8emboVZ+UzAfR4AGwkqSmAEdBjkDC8s0qSpLFHrDLYX82Owf KZjmJ3cC0emVjq2bNPGMnpgOLHaXYv3xPMvb4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=I1F+r4KbVfQw0YEsspOgMyQAvYScgYPfkrKxNzdICJgJC0yHb8cCa+7MuftxcAkN3n zWIBr1Sk/PbS4XNWtleV2n/TJFP9dt1FooRV4R1iwZ5RSzm8jsfaIuxzkVE733Afuzqf PmpqY7MSG4rxA20XCILghUs8u7uQePTwP0JnI=
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
---