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 _______________________________________________ Bug-gsl mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-gsl
