1999Q2/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] memory and speed -->
<!--X-From-R13: Quevf Uenl <ptNnzv&#45;pt.UenlEntr.Sqzbagba.OP.QO> -->
<!--X-Date: Thu, 10 Jun 1999 19:33:06 &#45;0700 -->
<!--X-Message-Id: 199906110230.UAA02724@ami&#45;cg.GraySage.Edmonton.AB.CA -->
<!--X-Content-Type: text/plain -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] memory and speed</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00732.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00734.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00750.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00752.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00733">Author</A>
&nbsp;|&nbsp;<A HREF="#00733">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00733">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] memory and speed</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Subject</em>: Re: [MUD-Dev] memory and speed</LI>
<LI><em>From</em>: Chris Gray &lt;<A HREF="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</A>&gt;</LI>
<LI><em>Date</em>: Thu, 10 Jun 1999 20:30:56 -0600</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Sender</em>: <A HREF="mailto:mud-dev-admin#kanga,nu">mud-dev-admin#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
[Matthew Mihaly:]

&gt; We tripled our memory today, from 128 megs to 384 megs, but we seem to
&gt; actually have slowed down. In fact, adding more memory has definitely
&gt; slowed us down. Some tasks are taking nearly twice as long as before. This
&gt; is extremely upsetting, to say the least. Anyone have any ideas?

[I've just finished going through 50 MUD-Dev messages - I'm going to put
all my performance comments here.]

Does your server code know about the extra RAM? i.e. are there parameters
you give it telling it how much it can use? If so, it may have some
code in it that increases its run-time in proportion to the amount of
stuff it has to work with. If not, then it sounds like something similar
is happening in the operating system. Is it Linux, Windows, commercial UNIX?

The normal reason to add RAM to a machine is to reduce the paging. I.e.
you are using more space than the real RAM, so the machine has to save
some of it to disk, then bring it back when its next needed - that's slow.
Adding more RAM helps there be enough space to not need to send things
to disk. If you aren't paging, its unlikely that more RAM will help.
How can you tell? On Unixes and Windows NT there are tools to tell you.
Task Manager on Windows, vmstat on many Unixes, including Linux.

Another possibility is disk I/O. Does your server have to read/write to
an on-disk database frequently? Mine does, but with good caching, it
isn't a problem. vmstat can tell you how much disk I/O you are doing.
When you machine is bagged, and you put your head beside it, can you
hear the disk continuously chittering away? If so, I'd suggest that
either paging (unlikely given the result with more RAM) or disk I/O
is costing you bigtime.

Matt, it sounds like most of your server's actual work is being done
by code written in the in-MUD language. While I agree that such an
interpreted language need not be a real bottleneck, I think that it
*can* be a bottleneck. The overhead imposed by such a language will
depend on a lot of things, such as:

    - amount of type checking and conversion needed at run-time
    - amount of C-code support functions available to be called
    - availability of lower-level facilities for special cases
    - the "level" of the language itself

Without knowing more details, its hard to say much more. Here are some
of the aspects of, and things I've done to, my interpreter to make it
faster:

    - its strongly typed. Therefore very little checking is needed at
	run-time, and no non-explicit conversions.

    - I have a *lot* of builtin-functions (coded in C) that the
	interpreted code can call on. Thus, even though my entire
	scenario is written in the MUD language, when it runs, it
	actually spends a lot of its time in C code.

    - I identified some things that I was doing that looked expensive,
	and wrote builtin-functions to do them (as generically as was
	reasonable).

    - I've added a byte-code compiler and machine to my system. So far
	it hasn't helped the X86 version as much as it did the 68K
	version, but I have more ideas to implement.

All of these issues can, I believe, account for a minimum of an order
of magnitude in the speed of the interpreted code. Possibly as high or
higher than 2 orders of magnitude. If nearly all of the action in your
MUD is being done by an interpreter at the slow end of that scale, then
that itself could be enough to cause your problems.

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

Chris Gray     cg#ami-cg,GraySage.Edmonton.AB.CA
               <A  HREF="http://www.GraySage.Edmonton.AB.CA/cg/">http://www.GraySage.Edmonton.AB.CA/cg/</A>


_______________________________________________
MUD-Dev maillist  -  MUD-Dev#kanga,nu
<A  HREF="http://www.kanga.nu/lists/listinfo/mud-dev">http://www.kanga.nu/lists/listinfo/mud-dev</A>


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00752" HREF="msg00752.html">Re: [MUD-Dev] memory and speed</A></strong>
<ul compact><li><em>From:</em> Miroslav Silovic &lt;silovic#zesoi,fer.hr&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00732.html">Re: [MUD-Dev] Game Economies</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00734.html">Re: [MUD-Dev] Text Parsing</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00750.html">Re: [MUD-Dev] memory and speed</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00752.html">Re: [MUD-Dev] memory and speed</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00733"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00733"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>Re: [MUD-Dev] memory and speed</STRONG>, <EM>(continued)</EM>
<ul compact>
<LI><strong><A NAME="00742" HREF="msg00742.html">Re: [MUD-Dev] memory and speed</A></strong>, 
Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Fri 11 Jun 1999, 04:35 GMT
<UL>
<LI><strong><A NAME="00748" HREF="msg00748.html">Re: [MUD-Dev] memory and speed</A></strong>, 
Mark Gritter <a href="mailto:mark#erdos,Stanford.EDU">mark#erdos,Stanford.EDU</a>, Fri 11 Jun 1999, 06:47 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00746" HREF="msg00746.html">Re: [MUD-Dev] memory and speed</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Fri 11 Jun 1999, 05:53 GMT
<UL>
<LI><strong><A NAME="00750" HREF="msg00750.html">Re: [MUD-Dev] memory and speed</A></strong>, 
Matthew Mihaly <a href="mailto:diablo#best,com">diablo#best,com</a>, Fri 11 Jun 1999, 15:24 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00733" HREF="msg00733.html">Re: [MUD-Dev] memory and speed</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Fri 11 Jun 1999, 02:33 GMT
<UL>
<LI><strong><A NAME="00752" HREF="msg00752.html">Re: [MUD-Dev] memory and speed</A></strong>, 
Miroslav Silovic <a href="mailto:silovic#zesoi,fer.hr">silovic#zesoi,fer.hr</a>, Fri 11 Jun 1999, 15:24 GMT
<UL>
<LI><strong><A NAME="00772" HREF="msg00772.html">Re: [MUD-Dev] memory and speed</A></strong>, 
Petri Virkkula <a href="mailto:pvirkkul#iki,fi">pvirkkul#iki,fi</a>, Fri 11 Jun 1999, 20:37 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><strong><A NAME="00759" HREF="msg00759.html">Re: [MUD-Dev] memory and speed</A></strong>, 
S. Patrick Gallaty <a href="mailto:choke#sirius,com">choke#sirius,com</a>, Fri 11 Jun 1999, 16:13 GMT
<UL>
<LI><strong><A NAME="00766" HREF="msg00766.html">Re: [MUD-Dev] memory and speed</A></strong>, 
Adam Wiggins <a href="mailto:adam#angel,com">adam#angel,com</a>, Fri 11 Jun 1999, 18:13 GMT
</LI>
</UL>
</LI>
</ul>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>