MOO-cows Mailing List Archive


[ Re: Server Improvement]

------- Start of forwarded message -------
X-Disclaimer: This message was received from outside Dartmouth's BlitzMail system.
In-Reply-To: <Pine.SUN.3.91.970318112846.9663C-100000@t9>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Tue, 18 Mar 1997 05:17:36 PST
From: "\"Michael J. Fromberger\"." <>
Subject: Re: Server Improvement
Precedence: bulk

At 03.38 -0800 3/18/97, chris wrote:
>Switch statements in C are meant to be very efficient (although that
>might change from compiler to compiler)
>What I would like to put up for discussion is the merits of using a array
>of pointers to functions instead of a switch statement, as this would
>eleminate the need to perform a integer search.
>Do people think that this would result in a significant performance boost?

Since, as you say, the implementation of this can and does vary from
cpmpiler to compiler, the boost you'd get for doing this will be hard to
estimate.  My guess is that the only way to get any real data would be to
build a copy of the server with profiling code in, and get some figures for
just how much time the instruction decode/dispatch really takes.  Armed
with that, it would be much easier to simulate some test cases done off a
dispatch vector and see what the magnitude of the improvement will be.

Broadly speaking, if we assume that the "standard" implementation is likely
to involve search of some kind (I have no idea if this is the case or not),
you'd expect to see some kind of performance boost for this.  However,
cache policies and size, register allocation, and memory architecture will
contribute heavily to the success of this venture.

Overall, it's not at all a bad idea, IMHO -- but it's impossible to say
what the exact effect will be without some testing.

- -M

 |:::::://|  Michael J. Fromberger         Tel 617 * 276 * 8885
 |{\:::// |  Software Toolsmith            FAX 617 * 276 * 8878
 |{\\://  |
 |::\//   | <>     <>
 +--------+ +------------------------------------------------------+
 VideoGuide          209 Burlington Road, Bedford, MA  01730
------- End of forwarded message -------

Home | Subject Index | Thread Index