Struct in C, are they efficient?
- by pygabriel
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.