This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: random variate from power exponential distribution: performances


For better optimization options have a look
of this page

http://home.comcast.net/~jcunningham63/linux/GCC_Optimization.html

Claudio


Giulio Bottazzi ha scritto:


On Mon, 27 Sep 2004 11:00:08 -0500
Linas Vepstas <linas@austin.ibm.com> wrote:



You should test again with optimization turned on. This can make a *huge* difference in relative performance. Without optimization,
the compiler does literally what the C code says, with an excess use
of register-to-register copies. Thus, and sort of redundant



Hi Linas, very good point! What you suggest is longer to say than to do

gcc -O3 -march=i686 -lgsl -lgslcblas testran.c -o testran

results (ignore the value for a, it doesn't matter) :

value for a value for b JOHNSON (secs) TADIKAMALLA (secs)

1.000000	0.500000	0.540000	3.630000
1.000000	0.600000	1.590000	2.880000
1.000000	0.700000	1.550000	2.500000
1.000000	0.800000	1.490000	2.290000
1.000000	0.900000	1.430000	2.170000
1.000000	1.000000	0.510000	0.220000
1.000000	1.100000	1.330000	2.160000
1.000000	1.200000	1.330000	2.180000
1.000000	1.300000	1.330000	2.160000
1.000000	1.400000	1.320000	2.180000
1.000000	1.500000	1.310000	2.180000
1.000000	1.600000	1.320000	2.170000
1.000000	1.700000	1.300000	2.170000
1.000000	1.800000	1.290000	2.180000
1.000000	1.900000	1.290000	2.180000
1.000000	2.000000	1.290000	0.410000
1.000000	2.100000	1.280000	4.370000
1.000000	2.200000	1.270000	4.370000
1.000000	2.300000	1.270000	4.360000
1.000000	2.400000	1.260000	4.370000
1.000000	2.500000	1.260000	4.370000
1.000000	2.600000	1.250000	4.370000
1.000000	2.700000	1.250000	4.380000
1.000000	2.800000	1.250000	4.380000
1.000000	2.900000	1.250000	4.380000
1.000000	3.000000	1.230000	3.920000
1.000000	3.200000	1.230000	4.390000
1.000000	3.400000	1.230000	4.370000
1.000000	3.600000	1.220000	4.370000
1.000000	3.800000	1.210000	4.370000
1.000000	4.000000	1.210000	3.960000


comment: things did not change, JOHNSON is ALWAYS faster.



BTW I've tested also on a dual opteron compiling with


gcc -O3 -lgsl -lgslcblas testran.c -o testran

guess what? same thing: JOHNSON is ALWAYS faster.


Any other optimization option to suggest?



G.









--
==========================================================
Claudio Attaccalite
PhD student in Condensed Matter Theory
S.I.S.S.A.
Via Beirut 2-4 34014 Grignano (TS)
email: attacc@sissa.it
ICQ number: 23970278
web site: http://www.freescience.info/claudio/
===========================================================


A quart of ale is a dish for a king. -William Shakespeare Winter's Tale


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]