no idea why memset should be slow - library functions are generally implemented using efficent code
it would be used so to initialise an array to 0
Code:
int x[500];
memset (x, 0, sizeof(x));
when static variables are created (i.e. defined outside function code) the values are initialised to 0
when variables are defined inside functions by default no initialisation is performed (you get whatever values happen to be in the memory allocated)
to initialise an array inside a function to 0 you can define it so (remember the array is allocated on every function call and deallocated on exit)