[Halld-offline] stl vector
David Lawrence
davidl at jlab.org
Mon May 9 12:21:19 EDT 2011
Hi Paul,
I actually tried your code on my 2.33GHz Core 2 duo laptop running
OS X 10.5 and got a much larger discrepancy. However, when I turned on
optimization, the discrepancy disappeared. Have you tried this test with
optimization turned on?
No Optimization
--------------
1:13.83 STL
0:04.83 double array
-O
--------------
0:03.63 STL
0:03.64 double array
-O2
--------------
0:03.68 STL
0:03.64 double array
Full transcript of session is below.
Regards,
-Dave
STL-vector
-------------------
wifi-80-86:STLTest>g++ stl-test.cc -o stl-test
wifi-80-86:STLTest>time ./stl-test
sumXsq = 2.69986e+17
71.068u 0.584s 1:13.83 97.0% 0+0k 0+0io 0pf+0w
wifi-80-86:STLTest>g++ -O stl-test.cc -o stl-test
wifi-80-86:STLTest>time ./stl-test
sumXsq = 2.69986e+17
3.498u 0.031s 0:03.63 96.9% 0+0k 0+0io 0pf+0w
wifi-80-86:STLTest>g++ -O2 stl-test.cc -o stl-test
wifi-80-86:STLTest>time ./stl-test
sumXsq = 2.69986e+17
3.496u 0.033s 0:03.68 95.6% 0+0k 0+0io 0pf+0w
double with malloc
-----------------
wifi-80-86:STLTest>g++ stl-test.cc -o stl-test
wifi-80-86:STLTest>time ./stl-test
sumXsq = 0
4.674u 0.036s 0:04.83 97.3% 0+0k 0+0io 0pf+0w
wifi-80-86:STLTest>g++ -O stl-test.cc -o stl-test
wifi-80-86:STLTest>time ./stl-test
sumXsq = 0
3.498u 0.032s 0:03.64 96.7% 0+0k 0+0io 0pf+0w
wifi-80-86:STLTest>g++ -O2 stl-test.cc -o stl-test
wifi-80-86:STLTest>time ./stl-test
sumXsq = 0
3.489u 0.027s 0:03.64 96.1% 0+0k 0+0io 0pf+0w
On 5/9/11 11:58 AM, Paul Eugenio wrote:
> g++ stl-test.cc -o stl-test
More information about the Halld-offline
mailing list