At 8:47 PM -0400 4/27/04, The Mage wrote:

It looks to me that this is a consequence of the server's method of compiling the code upon entry and discarding the source: no comments would survive this process intact unless they were evaluated. But this must have some cost in terms of execution time, mustn't it? Every evaluation must take some processor cycles, and therefore comment-ridden code would be: how much slower than commentless code?

As soon as I read of this implementation I acquired my early habit
of not commenting my code, not liking the idea of taking such a hit.
Was my fear justified.

I do not know the overhead of comments in the present version of lambdaMOO. However, many (8? 10?) years ago, we were using an earlier version of the lambdaMOO here at RPI with a database which was getting too large for the hardware it was running on. In that situation, we did actually go through our verbs and remove most of the comments. This produced a significant-enough performance boost that we were able to delay a machine-upgrade by about six months. At the time, this was a very good thing.

But now we really regret having lost all those comments.  We *meant*
to keep a copy of all the commented-verbs, but somehow we lost that
copy.

We now run on a much bigger machine, and the load of our MOO-based
service is pretty minor.  We're trying to re-comment the code, and
in some cases the code is very obtuse.  I'm sure that in some cases,
just a few simple lines of comments would save us a load of time in
figuring out what the verb is doing, and why it's doing that...

Anyway, we came up with one tactic to minimize the "overhead" of
the comments, without completely deleting them.  If I have some
large block of comments I want to write, I put them at the end of
the verb.  I put a 'return;' before the block of comments, and
then have the terminating '.' after all of them.  So, the large
comment block is in the verb, but none of the lines will need to
be interpreted.

--
Garance Alistair Drosehn            =   [EMAIL PROTECTED]
Senior Systems Programmer           or  [EMAIL PROTECTED]
Rensselaer Polytechnic Institute    or  [EMAIL PROTECTED]

#############################################################
This message is sent to you because you are subscribed to
 the mailing list <[EMAIL PROTECTED]>.
To unsubscribe, E-mail to: <[EMAIL PROTECTED]>
To switch to the DIGEST mode, E-mail to <[EMAIL PROTECTED]>
To switch to the INDEX mode, E-mail to <[EMAIL PROTECTED]>
Send administrative queries to  <[EMAIL PROTECTED]>



Reply via email to