Re: Class.c

From: George Greer (greerga@circlemud.org)
Date: 06/20/02


On Thu, 20 Jun 2002, Jason Yarber wrote:

>Oh, boy, we're talking about equations....my specialty.  As you can
>probably tell from my tablestoformula patch, I've already outlined the
>method of changing most of the switches to single line formulas, that may
>run faster than the switch. I'm pretty sure they won't run any slower.
>Now your looking for a perfect formula for the levels command.

I didn't mean a single formula necessarily.  If you need an extra formula
for other ranges, that's fine too.  For 3.1, I want it exactly the same.
After that they can be changed.

>As you see, unlike the switch code, this is much simpler, and tends to
>work just a tad faster, although you will probably never notice the
>difference.

Even the .0002 seconds was an overstatement because for each of the 100,000
loops, I ran the function for every possible combination of class, level,
and saving throw type.  So if you want to call level_exp() in a tight loop
millions of time, sure a switch isn't what you want.  Otherwise, who cares
about the speed.

--
George Greer
greerga@circlemud.org

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT