Mail Archives: djgpp/1998/07/20/04:28:57
On Mon, 20 Jul 1998, Mariano Alvarez Fernández wrote:
> 0.87 479.39 4.33 2688065 0.00 0.00 strtol
This (and other) entries indicate that you convert strings to integers
quite a lot. You might consider storing the integer values instead,
to cut the number of these conversions.
> 0.63 482.56 3.17 5284125 0.00 0.00 strcopnb
> 0.52 485.17 2.61 5284126 0.00 0.00 strncpy
> 0.48 487.56 2.39 5284125 0.00 0.00 strlen
These entries seem to imply that you call strlen for each call to
strcpy/strncpy. It would be faster to call memcpy/memmove instead,
since once you know the length of a string, there's no reason to use
the string-copy functions (which are slower because they look for the
terminating null character).
- Raw text -