bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gsl] gsl_vector_get / set


From: Brian Gough
Subject: Re: [Bug-gsl] gsl_vector_get / set
Date: Sat, 29 Nov 2008 14:39:08 +0000
User-agent: Wanderlust/2.14.0 (Africa) Emacs/22.2 Mule/5.0 (SAKAKI)

At Fri, 28 Nov 2008 11:26:49 +0100,
geist_mat wrote:
> 
> Hi,
> 
> Trying to optimize some code, i remarked that calling the gsl_vector_get
> function was much more slower than just accessing the structure with
> something like v->data[i*v->stride], and the same seems to hold for
> gsl_vector_set. On my program, it is about 15 time faster, however here
> is a simpler example.

Hello,

Have you checked the preprocessor output 'g++ -E ...' to make sure the
inline version of the function is being imported correctly?  I tried
the program and get the same speed in each case as would be expected.

-- 
Brian Gough

Support freedom by joining the FSF
http://www.fsf.org/news/fall-2008-fundraiser

$ g++ -Wall -O3 -DMANUAL -I ~/gsl -g inline.c  ~/gsl/.libs/libgsl.a  
(14:36)$ time ./a.out
0

real    0m2.795s
user    0m2.771s
sys     0m0.005s
(14:36)$ 

(14:36)$ g++ -Wall -O3 -DHAVE_INLINE -I ~/gsl -g inline.c  ~/gsl/.libs/libgsl.a 
 
(14:36)$ time ./a.out
0

real    0m2.797s
user    0m2.771s
sys     0m0.003s





reply via email to

[Prev in Thread] Current Thread [Next in Thread]