[Home] [Groups] - Message: [Prev in Group] [Next in Group]

nu.kanga.list.mud-dev

9821: Re: [MUD-Dev] Naming and Directories?

[Full Header] [Plain Text]
From: Chris Gray <cg@ami-cg.GraySage.Edmonton.AB.CA>
Newsgroups: nu.kanga.list.mud-dev
Date: Tue, 16 Mar 1999 23:11:32 -0700
Organization: Kanga.Nu
[Mark Gritter:]

 >Hmm... this seems unnecessary.  Wouldn't strcmp() quit as soon as there
 >was a difference in the strings anyway?  You'd only be saving the
 >function call overhead, which could be eliminated by inlining.

Most compiler systems can only inline functions that they have the
source to. So, that would work if you wrote your own strcmp(), but not
with the (possibly highly optimized) system one. I've used the trick
of doing a one-char check before calling a function, and it provided a
very noticeable benefit (it wasn't in a MUD, and it was quite a few
years ago, however).

--
Don't design inefficiency in - it'll happen in the implementation.

Chris Gray     cg@ami-cg.GraySage.Edmonton.AB.CA
               http://www.GraySage.Edmonton.AB.CA/cg/


_______________________________________________
MUD-Dev maillist  -  MUD-Dev@kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev