I have a very large program that I have inherited that I need to optimize and improve. (It has a number of componants that include C, Pro*C and Stored procedures in an Oracle database all running on HP Unix).

There are a large amount of calls to memcmp and memset.

The questions are

1. Would it be quicker to use strcmp than memcmp (since I am comparing strings)?

2. Rather than clearing allocated memory by memseting it to null would it be better to free then malloc or even realloc?

I'm fairly new to C and have not yet mastered the art of optimization!