|Re: [eigen] Nesting by reference of by value ?|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Nesting by reference of by value ?
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Wed, 18 Nov 2009 15:07:51 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=w8AiMV3z2S0N5nMDeegp9scrae2HGbggMdvNnHxDpkQ=; b=c6DTwkURBuWugcmMoOlalICJP7HhCtFzhOlpPGiT8X4sQmMHQkC9qizuoG8kyLiNaT Aq6RUa55nPb9aVDq+CDYGq/M0k19cY7VMUoxUoj0Fcjp1xg/CCDMNZWzMx0crHC53f3K AfsjKDmHXNH3T3KvLmjC9tzRx1G9DSEWi/JKc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=eHMJ6UU9sfgr8ry2X53/4+DkVKlXwetkDAbONFR4RXQ6II21Mi16EzD5XrMMXYLt/Y rBo59KlINQ7F3tw+Roy1cVIjCXLPUYJuoM2qUMRT4l/kVmNCvN6nCcDX8WFYNFZu6E1E tvxpbShgY60isMTrtChPH7KQTi2y9tRSjPaeQ=
2009/11/18 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:
> ok, actually I forgot the rules #1 when benchmarking gcc, never put your
> critical code in the main function, but put it in a separated, not inlined,
> function. So now, for the same computation, gcc 4.3 and 4.4 generate good
> code in both cases. gcc 4.2 still generates the same poor code as above.
I didn't know about that rule, interesting! In any case, if you just
want to examine ASM, you don't need a main function at all, you can
just do "g++ -c" so you don't have to worry about inlining.
> Then I tried the same computation but with VectorXf instead of Vector4f.
> Then both gcc 4.2 and 4.3 generates a better code for the inner vectorized
> loop when nesting by value. I observed a significant speedup here. However,
> gcc 4.4 generates the same code in both cases.
> Then I added some scalar multiple and sub matrix operations, and well, there
> is no real winner, especially with gcc 4.4 which consistently generates
> similar code. So finally, for me this change is safe regarding the
> Now it would be interesting to bench MSVC as well since it seems this
> compiler has more difficulties to manage Eigen's code, but this is something
> I cannot do.