1999Q2/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] bytecode results -->
<!--X-From-R13: Quevf Uenl <ptNnzv&#45;pt.UenlEntr.Sqzbagba.OP.QO> -->
<!--X-Date: Thu, 15 Jul 1999 17:43:11 &#45;0700 -->
<!--X-Message-Id: 199907152221.QAA03578@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, [MUD-Dev] bytecode results</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="msg00918.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00920.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00924.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00910.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00919">Author</A>
&nbsp;|&nbsp;<A HREF="#00919">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00919">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] bytecode results</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>: [MUD-Dev] bytecode results</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, 15 Jul 1999 16:21:25 -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>
As some of the folks who have been on the list for a while may remember, I've
been messing around with a bytecode engine for my MUD. It already has a
parse-tree interpreter, but I wanted to see if I could squeeze more speed
out of it. Also, its been great fun doing it. Anyway, I've now finished
off the X86 version of the bytecode engine, and thought I would report
the results here in case someone else is thinking of doing something like
this. Everything is straight ANSI C code, except that I've used gcc's
language extension of label variables. Here is a cut from one of my
documentation files I've just updated:


The final results for this machine (300 Mhz P-II running Linux) are (the
test program in this case is 100 iterations of the 256x256 fractal terrain
generation, done in a very straightforward way):

	Unoptimized MUD server:

	    tree interpreter:	187 seconds
	    bytecode machine:	77 seconds

	Optimized MUD server:

	    tree interpreter:	93 seconds
	    bytecode machine:	31 seconds

	Native code:

	    unoptimized:	4 seconds
	    optimized:		2 seconds


So, in this case, the bytecode machine is about 15 times slower than
native execution and only about 3 times faster than the tree interpreter,
fitting in with the conjectures above.

Repeating the original "Towers of Hanoi" experiment:

	Unoptimized MUD server:

	    tree interpreter:	n = 22: 57	n = 23: 114
	    bytecode machine:	n = 22: 14	n = 23:  29

	Optimized MUD server:

	    tree interpreter:	n = 22: 34	n = 23:  68
	    bytecode machine:	n = 22:  4	n = 23:   9

	Native code:

	    unoptimized:	n = 22: 0.53	n = 23: 1.08
	    optimized:		n = 22: 0.68	n = 23: 1.40

The native code times are wierd. Proper optimization flags to gcc (I just
used '-O') should get better optimized times than unoptimized. With this
example, bytecode is 4 - 8 times faster than the tree interpreter, and
7 - 8 times slower than native code.

--
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>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00918.html">Re: [MUD-Dev] an idea..wondering if this has been done</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00920.html">Re: [MUD-Dev] GM Touring Company</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00924.html">Re: [MUD-Dev] fwd: forum on game design/culture</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00910.html">[MUD-Dev] pfiles</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00919"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00919"><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] Containing automation?</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<LI><strong><A NAME="00955" HREF="msg00955.html">RE: [MUD-Dev] Containing automation?</A></strong>, 
Matthew Mihaly <a href="mailto:diablo#best,com">diablo#best,com</a>, Tue 20 Jul 1999, 20:32 GMT
</LI>
</ul>
<LI><strong><A NAME="00949" HREF="msg00949.html">RE: [MUD-Dev] Containing automation?</A></strong>, 
Ilya, SCC, Game Commando <a href="mailto:Ilya#gamecommandos,com">Ilya#gamecommandos,com</a>, Tue 20 Jul 1999, 18:56 GMT
</LI>
</ul>
</LI>
<LI><strong><A NAME="00921" HREF="msg00921.html">[MUD-Dev] fwd: forum on game design/culture</A></strong>, 
Brandon J. Rickman <a href="mailto:ashes#pc4,zennet.com">ashes#pc4,zennet.com</a>, Fri 16 Jul 1999, 01:58 GMT
<UL>
<LI><strong><A NAME="00924" HREF="msg00924.html">Re: [MUD-Dev] fwd: forum on game design/culture</A></strong>, 
Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Fri 16 Jul 1999, 05:21 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00919" HREF="msg00919.html">[MUD-Dev] bytecode results</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Fri 16 Jul 1999, 00:43 GMT
<LI><strong><A NAME="00910" HREF="msg00910.html">[MUD-Dev] pfiles</A></strong>, 
yacketta <a href="mailto:yacketta#kodak,com">yacketta#kodak,com</a>, Thu 15 Jul 1999, 18:24 GMT
<UL>
<LI><strong><A NAME="00923" HREF="msg00923.html">Re: [MUD-Dev] pfiles</A></strong>, 
Richard Woolcock <a href="mailto:KaVir#dial,pipex.com">KaVir#dial,pipex.com</a>, Fri 16 Jul 1999, 02:40 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00909" HREF="msg00909.html">[MUD-Dev] Victim Characters (was: Critiquing Muds)</A></strong>, 
Eli Stevens (KiZurich/GreySylk) <a href="mailto:c718157#showme,missouri.edu">c718157#showme,missouri.edu</a>, Thu 15 Jul 1999, 18:24 GMT
<LI><strong><A NAME="00905" HREF="msg00905.html">[MUD-Dev] an idea..wondering if this has been done</A></strong>, 
Willowreed <a href="mailto:Willowreed#aol,com">Willowreed#aol,com</a>, Thu 15 Jul 1999, 02:53 GMT
</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>