Mail Archives: djgpp/1999/11/15/20:32:44
Nate Eldredge (neldredge AT hmc DOT edu) wrote:
: alainm AT news DOT mcgill DOT ca (Alain Magloire) writes:
: > Malcolm (donald DOT mcleanNOdoSPAM AT talk21 DOT com DOT invalid) wrote:
: > : What does strset do ? I imagine it sets a string to all one
: > : character. This is easy to code
: >
: > Then, in that case you are better off with memset() which on most
: > OS/libc coded in assembly for speed.
: Not necessarily-- if you don't know the length of the string, you'd
: have to do `memset(s, 'X', strlen(s))', which requires making two
: passes over the string and could end up being slower.
Hum .. I don't want to get involve in that sort of overkill optimization.
I have no idea what strset() is , my point was just to prefer
mem*() API when possible.
Donald Knuth said :
"Premature Optimization is the Root of All Evil."
Thinking you'll get a noticable gain by rewritten parts of lib C funtions
on modern CPU, is misleading. Especially for simple things like
the above.
Of Couse my 0.02$ Canadian
--
au revoir, alain
----
Aussi haut que l'on soit assis, on est toujours assis que sur son cul !!!
- Raw text -