Benchmark Results for <I>matrix.sa</I>

Benchmark Results for matrix.sa

(For questions about these benchmarks send eMail to Claudio Fleiner)

This is the "real" Matrix Multiplaktion program matrix.sa. It multiplies two 300x300 matrices. Note that the equivalent C (matrix.c) and C++ (matrix.cc) are nearly an order of magnitude slower, unless they are optimized by hand (opt_matrix.c and opt_matrix.cc).

Programnon optimizedcompiler optimizedhand optimized
Sather96.912.3n/a
C87.558.39.9
C++91.257.612.7

The C and C++ version were compiled with GCC 2.7.1 and -O3.

Note that GCC cannot do much better without inter procedural analysis, as it has to prove that each write to one of the elements of the matrix does not change the size of any of the matrices involed, which could happen if the memory region of the three matrices overlap.

Table of Contents

General Results:

# [#] Compiler Options *Best Run* Size of Executable Compile Time Memory Usage
Inline Move
while!
Once
Args.
Hoist
Invar.
CSE *sec. *% of
std
KB Shorter
in %
sec. % of
std
KB % of
std
1. Standard Compiler with no options 237.90100.0%1850.0%11.22100.0%6328.95100.0%
2. [23] 11.805.0%10941.3%20.15179.6%9970.05157.5%
3. [22] 11.905.0%10941.3%20.21180.1%9985.23157.8%
4. [31]12.305.2%10941.0%20.98187.0%9910.83156.6%
5. [30] 12.405.2%10941.0%20.65184.0%10635.95168.1%
6. [27] 12.805.4%11040.7%21.04187.5%10253.04162.0%
7. [19] 12.805.4%10941.0%20.43182.1%10077.00159.2%
8. [26] 12.905.4%11040.7%20.76185.0%10221.57161.5%
9. [18] 12.905.4%10941.0%20.33181.2%9848.42155.6%
10. [29] 63.3026.6%10941.1%17.00151.5%9975.40157.6%
11. [24] 63.4026.6%10940.8%16.91150.7%9897.57156.4%
12. [25] 63.4026.6%10940.8%16.90150.6%9583.00151.4%
13. [21] 63.4026.6%10841.4%16.29145.2%10004.07158.1%
14. [28] 63.4026.6%10941.1%16.93150.9%10016.77158.3%
15. [16] 63.9026.9%10941.1%16.33145.5%9888.56156.2%
16. [17] 63.9026.9%10941.1%16.35145.7%9966.39157.5%
17. [20] 64.4027.1%10841.4%16.28145.1%9556.79151.0%
18. [05] 96.4040.5%10940.9%14.20126.6%7774.21122.8%
19. [15] 96.4040.5%11040.6%15.76140.5%7941.32125.5%
20. [04] 96.4040.5%10940.9%14.26127.1%7786.50123.0%
21. [14] 96.5040.6%11040.6%15.76140.5%7915.93125.1%
22. [06] 96.5040.6%10940.9%15.60139.0%7778.30122.9%
23. [12] 96.8040.7%11040.6%14.75131.5%7808.34123.4%
24. [07] 96.9040.7%10940.9%15.41137.3%7876.29124.4%
25. [00] 96.9040.7%11040.6%14.30127.5%7752.09122.5%
26. [13] 96.9040.7%11040.6%14.84132.3%7889.72124.7%
27. [09] 97.0040.8%11040.3%14.86132.4%7825.41123.6%
28. [08] 97.1040.8%11040.3%14.73131.3%7815.17123.5%
29. [01] 97.4040.9%11040.6%14.52129.4%7834.01123.8%
30. [03] 97.8041.1%11040.6%15.66139.6%7818.58123.5%
31. [02] 97.8041.1%11040.6%15.61139.1%7777.48122.9%
32. [10] 97.9041.2%11040.3%16.42146.3%7788.13123.1%
33. [11] 98.0041.2%11040.3%16.04143.0%7960.99125.8%

Impact of the option "Inlining":

# [# / #] Compiler Options *Best Run* Size of Executable Compile Time Memory Usage
Inline Move
while!
Once
Args.
Hoist
Invar.
CSE Faster
in sec.
*Faster
in % *
Shorter
in KB
Shorter
in %
Slower
in sec.
Slower
in %
change
in KB
change
in %
1. [07/23] 85.1087.82%00.69%4.7430.76%-2093761-26.58%
2. [06/22] 84.6087.67%00.68%4.6129.55%-2206924-28.37%
3. [15/31]84.1087.24%00.62%5.2233.12%-1969505-24.80%
4. [14/30] 84.1087.15%00.62%4.8931.03%-2720017-34.36%
5. [11/27] 85.2086.94%00.59%5.0031.17%-2292056-28.79%
6. [03/19] 85.0086.91%00.65%4.7730.46%-2258421-28.89%
7. [10/26] 85.0086.82%00.58%4.3426.43%-2433433-31.25%
8. [02/18] 84.9086.81%00.66%4.7230.24%-2070937-26.63%
9. [08/24] 33.7034.71%00.79%2.1814.80%-2082406-26.65%
10. [13/29] 33.6034.67%00.81%2.1614.56%-2085683-26.44%
11. [09/25] 33.6034.64%00.78%2.0413.73%-1757593-22.46%
12. [12/28] 33.4034.50%00.79%2.1814.78%-2208426-28.28%
13. [01/17] 33.5034.39%00.80%1.8312.60%-2132377-27.22%
14. [05/21] 33.0034.23%00.82%2.0914.72%-2229862-28.68%
15. [00/16] 33.0034.06%00.81%2.0314.20%-2136473-27.56%
16. [04/20] 32.0033.20%00.82%2.0214.17%-1770291-22.74%

Impact of the option "Moving while! and until!":

# [# / #] Compiler Options *Best Run* Size of Executable Compile Time Memory Usage
Inline Move
while!
Once
Args.
Hoist
Invar.
CSE Faster
in sec.
*Faster
in % *
Shorter
in KB
Shorter
in %
Slower
in sec.
Slower
in %
change
in KB
change
in %
1. [20/28] 1.001.55%0-0.47%0.653.99%-459980-4.81%
2. [17/25] 0.500.78%0-0.46%0.553.36%3833853.85%
3. [16/24] 0.500.78%0-0.45%0.583.55%-9011-0.09%
4. [07/15] 0.500.52%0-0.42%0.352.27%-65031-0.83%
5. [01/09] 0.400.41%0-0.44%0.342.34%86010.11%
6. [21/29] 0.100.16%0-0.46%0.714.36%286720.29%
7. [19/27] 0.000.00%0-0.48%0.612.99%-176039-1.75%
8. [06/14] 0.000.00%0-0.42%0.161.03%-137625-1.77%
9. [18/26] 0.000.00%0-0.49%0.432.12%-373145-3.79%
10. [02/10] -0.10-0.10%0-0.41%0.815.19%-10649-0.14%
11. [03/11] -0.20-0.20%0-0.42%0.382.43%-142404-1.82%
12. [00/08] -0.20-0.21%0-0.43%0.433.01%-63078-0.81%
13. [04/12] -0.40-0.41%0-0.44%0.493.44%-21845-0.28%
14. [05/13] -0.50-0.52%0-0.44%0.644.51%-115507-1.49%
15. [22/30] -0.50-4.20%0-0.48%0.442.18%-650717-6.52%
16. [23/31]-0.50-4.24%0-0.48%0.834.12%592230.59%

Impact of the option "Hoisting Iter Initialization":

# [# / #] Compiler Options *Best Run* Size of Executable Compile Time Memory Usage
Inline Move
while!
Once
Args.
Hoist
Invar.
CSE Faster
in sec.
*Faster
in % *
Shorter
in KB
Shorter
in %
Slower
in sec.
Slower
in %
change
in KB
change
in %
1. [19/23] 1.007.81%00.54%-0.28-1.37%1069491.06%
2. [18/22] 1.007.75%00.53%-0.12-0.59%-136806-1.39%
3. [27/31]0.503.91%00.54%-0.06-0.29%3422113.34%
4. [26/30] 0.503.88%00.54%-0.11-0.53%-414378-4.05%
5. [11/15] 1.601.63%00.51%-0.28-1.75%196600.25%
6. [10/14] 1.401.43%00.51%-0.66-4.02%-127795-1.64%
7. [02/06] 1.301.33%00.51%-0.01-0.06%-819-0.01%
8. [01/05] 1.001.03%00.50%-0.32-2.20%598010.76%
9. [03/07] 0.900.92%00.51%-0.25-1.60%-57711-0.74%
10. [17/21] 0.500.78%00.52%-0.06-0.37%-37683-0.38%
11. [00/04] 0.500.52%00.52%-0.04-0.28%-34406-0.44%
12. [08/12] 0.300.31%00.51%0.020.14%68260.09%
13. [25/29] 0.100.16%00.52%0.100.59%-392396-4.09%
14. [09/13] 0.100.10%00.50%-0.02-0.13%-64307-0.82%
15. [24/28] 0.000.00%00.52%0.020.12%-119193-1.20%
16. [16/20] -0.50-0.78%00.53%-0.05-0.31%3317763.36%

Impact of the option "Hoisting Loop Invariants":

# [# / #] Compiler Options *Best Run* Size of Executable Compile Time Memory Usage
Inline Move
while!
Once
Args.
Hoist
Invar.
CSE Faster
in sec.
*Faster
in % *
Shorter
in KB
Shorter
in %
Slower
in sec.
Slower
in %
change
in KB
change
in %
1. [20/22] 52.5081.52%0-0.19%3.9324.14%-428441-4.48%
2. [21/23] 51.6081.39%0-0.18%3.8623.70%340160.34%
3. [29/31]51.0080.57%0-0.20%3.9823.41%645670.65%
4. [28/30] 51.0080.44%0-0.20%3.7221.97%-619178-6.18%
5. [17/19] 51.1079.97%0-0.20%4.0824.95%-110616-1.11%
6. [16/18] 51.0079.81%0-0.19%4.0024.49%401400.41%
7. [25/27] 50.6079.81%0-0.22%4.1424.50%-670040-6.99%
8. [24/26] 50.5079.65%0-0.23%3.8522.77%-323993-3.27%
9. [13/15] 0.500.52%0-0.01%0.926.20%-51609-0.65%
10. [12/14] 0.300.31%0-0.03%1.016.85%-107588-1.38%
11. [04/06] -0.10-0.10%0-0.04%1.349.40%81920.11%
12. [01/03] -0.40-0.41%0-0.05%1.147.85%154280.20%
13. [05/07] -0.50-0.52%0-0.04%1.218.52%-102084-1.31%
14. [08/10] -0.80-0.82%0-0.02%1.6911.47%270330.35%
15. [00/02] -0.90-0.93%0-0.04%1.319.16%-25395-0.33%
16. [09/11] -1.00-1.03%0-0.03%1.187.94%-135577-1.73%

Impact of the option "Common Subexpression Elimination":

# [# / #] Compiler Options *Best Run* Size of Executable Compile Time Memory Usage
Inline Move
while!
Once
Args.
Hoist
Invar.
CSE Faster
in sec.
*Faster
in % *
Shorter
in KB
Shorter
in %
Slower
in sec.
Slower
in %
change
in KB
change
in %
1. [20/21] 1.001.55%0-0.01%0.010.06%-447283-4.68%
2. [22/23] 0.100.84%00.00%-0.06-0.30%151740.15%
3. [30/31]0.100.81%00.00%0.331.60%7251166.82%
4. [26/27] 0.100.78%00.00%0.281.35%-31474-0.31%
5. [18/19] 0.100.78%0-0.01%0.100.49%-228580-2.32%
6. [28/29] 0.100.16%00.00%0.070.41%413690.41%
7. [14/15] 0.100.10%00.00%0.000.00%-25395-0.32%
8. [08/09] 0.100.10%00.00%0.130.88%-10240-0.13%
9. [02/03] 0.000.00%00.00%0.050.32%-41096-0.53%
10. [24/25] 0.000.00%0-0.01%-0.01-0.06%3145723.18%
11. [04/05] 0.000.00%0-0.01%-0.06-0.42%122880.16%
12. [16/17] 0.000.00%00.00%0.020.12%-77824-0.79%
13. [10/11] -0.10-0.10%0-0.01%-0.38-2.31%-172851-2.22%
14. [12/13] -0.10-0.10%0-0.01%0.090.61%-81373-1.04%
15. [06/07] -0.40-0.41%0-0.01%-0.19-1.22%-97988-1.26%
16. [00/01] -0.50-0.52%00.01%0.221.54%-81920-1.06%