[eigen] Re: Eigen 2 to Eigen 3 performance regressions with mapped matrices
• To: Keir Mierle <mierle@xxxxxxxxx>
• Subject: [eigen] Re: Eigen 2 to Eigen 3 performance regressions with mapped matrices
• From: Sameer Agarwal <sameeragarwal@xxxxxxxxxx>
• Date: Tue, 10 Jan 2012 23:49:45 -0800
• Cc: eigen <eigen@xxxxxxxxxxxxxxxxxxx>, tucker@xxxxxxxxxx
• Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:x-system-of-record:content-type; bh=yyP9oLXSrixdA1SYotxci/zk5RnZWbCx2l/A8t1H5qo=; b=DjuJEsI0eA9Qn3Xf+nAn9VFZF+f1VDUB1c+W74wbs64jVVvzzBs/jMP2cPwwCvUCn/ 55UM4J50gXOgb+7ovO9OvR0xcYjdqEK6klEjP6XXJiB9Gpfr2/wThkD83jEuKTO5X4bk O4qqRcUt7QX7YhsorossShOnYkLjC1sGT4CC0=

Here are some more results using keir's code + gcc 4.6.

I varied n (rows) and m (columns) from 1 to 10 and took the ratio of the time per call for eigen3 to eigen2. The general trend seems to be that the smaller the matrix, worse is the performance. Each test was repeated sufficient number of times so as to make statistical variations be insignificant.

1     2     3     4     5     6     7     8     9    10
------------------------------------------------------------
1| 17.75 14.20 14.80 12.50  9.62  9.88  9.00 10.38  8.90  9.00
2| 13.80  8.88  8.33  7.60  7.18  6.15  5.60  5.31  4.83  4.74
3| 12.17  9.62  8.89  7.64  6.77  6.43  5.81  5.39  5.00  5.30
4| 10.29  7.18  6.23  5.67  5.06  4.57  4.43  4.32  4.42  3.93
5| 10.86  8.20  6.62  6.20  5.67  5.05  4.87  4.58  4.50  4.29
6|  9.50  6.46  5.56  5.05  4.35  4.19  3.87  3.67  3.69  3.46
7| 10.00  6.62  5.94  5.42  4.70  4..37  4.06  4.03  3.81  3.66
8|  9.00  5.44  5.05  4.46  4.32  3.94  3.89  3.63  3.64  3.58
9|  9.22  6.20  5.20  4.79  4.61  4.27  3.95  3.79  3.60  3.54
10|  8.30  5.17  4.77  4.07  3.94  3.56  3.56  3.24  3.20  3.02

Sameer

On Tue, Jan 10, 2012 at 7:58 PM, Keir Mierle wrote:
I've attached a microbenchmark that is similar in spirit to what we are doing with Eigen, that illustrates slowdown from Eigen 2 to Eigen 3. In particular, the benchmark does y += A*x, for A, x, y mapped unaligned dynamic but small dimension matrices. It could be that I have not chosen appropriate compiler flags. I am seeing performance 2x to 3x worse. Take a look at the header comments in the attached benchmark for more numbers.

Keir

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