Struct in C, are they efficient?
Posted
by pygabriel
on Stack Overflow
See other posts from Stack Overflow
or by pygabriel
Published on 2010-03-12T09:44:24Z
Indexed on
2010/03/12
9:47 UTC
Read the original article
Hit count: 357
I'm reading some C code like that:
double function( int lena,double xa,double ya, double za, double *acoefs, ...,
int lenb,double xb,double yb, double zb, double *bcoefs, ...,
same for c,
same for d )
This function is called in the code mor than 100.000 times so it's performance-critical.
I'm trying to extend this code but I want to know if it's efficient or not (and how much this influences the speed) to encapsulate all the parameters in a struct like this
struct PGTO { int len; double x,y,z ; double *acoefs }
and then access the parameters in the function.
© Stack Overflow or respective owner