Some info back :)  15 second boot time with hashing and the stread_* funcs.

Mem:
Affects             5243
Areas                155
ExDes               3606
Exits              26922
Helps                724
Graphics              36
Socials              319
Mobs                3967
DelMobs                0
(in use)            7199
Mob Loss               0
Objs                5500
DelObjs                0
(in use)           10290
Obj Loss               0
Resets             17742
Rooms              11994
Clans                 10
PC Races              16
Classes               19
Hints                 55
Shops                314
Strings            55794 strings of 5369519 bytes (max 8192000).
Perms             122246 blocks  of 24939688 bytes.
Slack Mem:           728 bytes.
Open Files:            1 files.
Open Descs:            2 Descriptors.

-

And for the boot..

Script started on Mon Jul 21 23:35:38 2003
[EMAIL PROTECTED] area]$ ../Proc/vle  ile = -p 2040 -o vileconfig.cfg
Mon Jul 21 23:35:54 2003 :: Startup Limit was -1
Mon Jul 21 23:35:54 2003 :: Startup Limit is now -1
Mon Jul 21 23:35:54 2003 :: Done loading them all
Mon Jul 21 23:35:54 2003 :: Loading Ispell Deamon.
Mon Jul 21 23:35:54 2003 :: Loading all VILE Classes.
Mon Jul 21 23:35:54 2003 :: [*****] BUG: Load_class: # not found. Classfile
../Classes/Scholar
Mon Jul 21 23:35:54 2003 :: Class Detective does not have skill dirt kicking
in group detective default.
Mon Jul 21 23:35:54 2003 :: Class Detective does not have skill bigby bash
in group beguiling.
Mon Jul 21 23:35:54 2003 :: Class Detective does not have skill smoke screen
in group beguiling.
Mon Jul 21 23:35:54 2003 :: Class Detective does not have skill energy drain
in group maledictions.
Mon Jul 21 23:35:54 2003 :: Loading all VILE Races.
Mon Jul 21 23:35:54 2003 :: [*****] BUG: Load_race: # not found.
Mon Jul 21 23:35:54 2003 :: Loading auction system.
Mon Jul 21 23:35:54 2003 :: Loading weather system.
Mon Jul 21 23:35:54 2003 :: Loading Denied database.
Mon Jul 21 23:35:54 2003 :: Loading Email database.
Mon Jul 21 23:35:54 2003 :: Loading configuration file.
Mon Jul 21 23:35:54 2003 :: Testing for Revered Vnums.
Mon Jul 21 23:35:54 2003 :: Connecting to MySQL.
Mon Jul 21 23:35:54 2003 :: Loading protected VNUMS database.
Mon Jul 21 23:35:54 2003 :: Loading clan definitions.
Mon Jul 21 23:35:54 2003 :: Loading clan WAR definitions.
Mon Jul 21 23:35:55 2003 :: Loading Area Files.
Mon Jul 21 23:35:59 2003 :: Loading Area checkers.
Mon Jul 21 23:35:59 2003 :: Loading the Resets.
Mon Jul 21 23:35:59 2003 :: [*****] BUG: Err: obj a short sword (24317) -- 
6, mob an entertainer (24123) -- 12
Mon Jul 21 23:35:59 2003 :: [*****] BUG: Equip_char: npc 24123 (an
entertainer) already equipped 17, R[24113]
Mon Jul 21 23:35:59 2003 :: [*****] BUG: Equip_char: npc 4405 (a club kid)
already equipped 15, R[4449]
Mon Jul 21 23:36:08 2003 :: Loading Note Database.
Mon Jul 21 23:36:08 2003 :: Loading Social Database.
Mon Jul 21 23:36:09 2003 :: Loading BAN Database.
Mon Jul 21 23:36:09 2003 :: Loading Wizlist.
Mon Jul 21 23:36:09 2003 :: Loading Bank Database.
Mon Jul 21 23:36:09 2003 :: Loading Music Database.
Mon Jul 21 23:36:09 2003 :: Loading System Data.
Mon Jul 21 23:36:09 2003 :: Loading Clan Roster files.
Mon Jul 21 23:36:09 2003 :: Loading Newbie Hints.
Mon Jul 21 23:36:09 2003 :: End of BOOTING: Str_empty = --
Mon Jul 21 23:36:09 2003 :: VILE Running.  Port 2040. Boot Time 15.

[EMAIL PROTECTED] area]$ exit
exit

Script done on Mon Jul 21 23:36:16 2003

If you have any question s as to what is what, let me know.

I have things in there that garrentee things like core files are dumped,
etc..

Here is some more memory information.  I love it:)
Permanent Allocated Memory Blocks:
Block size:           262144 bytes
Alloc alignment:           4 bytes
Blocks allocated:         96 (25165824 bytes)
Current block used:        0 bytes (262144 free)
Block slack space:       728 bytes (0 recoverable)

Strings:   55794 strings =  5369519 bytes (8192000 max)
 (free):                 =  2822481 bytes (34.5%)
 (dup):    43092 strings =  1290197 bytes (saved)
Perms:    122253 blocks = 24940200 bytes
 (boot):  121134 blocks = 24708912 bytes
 (diff):    1119 blocks =   231288 bytes
Total:    178047 blocks  = 30309719 bytes

Magic number size:         4 bytes
Free_mem errors:           0
Bugs:                      7


And even more.

ategory           Top   Used  Free  Lost
=========================================
Affects:         5243  8416     0 -3173 (0) deleted
Areas:                  155     0   153
Bans:               0     2     0    -2
Characters:            7201     0  7201 (0) deleted
Descriptors:              2     0     2
Help items:             724     0   724
Notes:                   59     0    59
Objects:              10290     3 10287 (0) deleted
PC data:                  2     0     2
PC generation:      0     0     0     0
Shops:                  314     0   314


----- Original Message ----- 
From: "Jason Gauthier" <[EMAIL PROTECTED]>
To: "'Chris "Winston" Litchfield'" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Monday, July 21, 2003 11:28 PM
Subject: RE: Simple Performance Speedup.


>
>
> > -----Original Message-----
> > From: Chris "Winston" Litchfield [mailto:[EMAIL PROTECTED]
> > Sent: Monday, July 21, 2003 5:36 PM
> > Cc: [email protected]
> > Subject: Re: Simple Performance Speedup.
> >
> >
> > I have 155 areas and then once loaded I do some checking on
> > things such as: Does a key have an room/object? Does a locked
> > room have a key? Do room exits loop themselves?
>
> I wrote a very elaborate command called 'audit' that does this for me.
> I make my builders use it. When they are done, I use it too.  I make sure
> the areas are clean, and then load them.
>
> I contributed this awhile ago, if you cannot find it, I'll re-submit it.
It
> requires modification to use on any mud.
>
> > all sorts of building checks are done to contribute to the
> > now 13 second boot time :)
>
> [EMAIL PROTECTED]:~/pendulus/area$  ../pendulus/rom 1234
> Fix_mobprogs: code vnum 8406 not found (mob: 8406).
> Mon Jul 21 23:26:32 2003:     Pendulus is ready on port 1234. (pid: 14307)
> Booted:
> Usr time:  0.71000
> Sys time:  0.17000
> Real time: 0.90897
> Page faults: 336
> Page reclaims: 15950
> Swaps: 0
> -=-=-=-=
> Affects  4730
> Areas     117
> ExDes    1995
> Exits   21320
> Helps     551
> Socials   245
> Mobs     3405
> (in use)14772
> Objs     5319
> Resets  20095
> Rooms   353107
> Shops     286
>
>
>
>
> My theory is there is always room for improvement!
> But to get this any faster is beyond my abilities. (in pure code)
>
> > Chris
> > ----- Original Message ----- 
> > From: "Jason Gauthier" <[EMAIL PROTECTED]>
> > To: "'Chris "Winston" Litchfield'" <[EMAIL PROTECTED]>
> > Cc: <[email protected]>
> > Sent: Monday, July 21, 2003 1:48 PM
> > Subject: RE: Simple Performance Speedup.
> >
> >
> > > Holy crap, that's very impressive.
> > > If you have a large number of rooms, the hashing of vnums
> > slows things
> > down.
> > > I removed all hashing, and created arrays.
> > >
> > > But, this only makes a difference if your mud is huge. (I have 350k)
> > rooms.
> > >
> > > That's it off the top of my head.
> > >
> > >
> > > >
> > > > -----Original Message-----
> > > > From: Chris "Winston" Litchfield [mailto:[EMAIL PROTECTED]
> > > > Sent: Sunday, July 20, 2003 9:25 PM
> > > > Cc: [email protected]
> > > >
> > > > Okay,
> > > >
> > > > I have written the stread_* functions and made the areas work.
> > > > saved 6 seconds off my 18 second boot time.  That is better.
> > > >
> > > > Any other performance increases you can think of?
> > > >
> > > > Thanks,
> > > > Chris
> > > > ----- Original Message -----
> > > > From: "Jason Gauthier" <[EMAIL PROTECTED]>
> > > > To: "'Chad Simmons'" <[EMAIL PROTECTED]>; "Chris Winston
> > Litchfield"
> > > > <[EMAIL PROTECTED]>
> > > > Cc: <[email protected]>
> > > > Sent: Friday, July 18, 2003 8:46 AM
> > > > Subject: RE: Simple Performance Speedup.
> > > >
> > > >
> > > > > Actually, it looks like he wants to boost performance at
> > > > mud startup. And
> > > > > he's on the right track.
> > > > > However, with fread_* functions you will always be limited
> > > > because of the
> > > > > nature of the functions.
> > > > >
> > > > > If you truely want to increase mud boot time, here's what
> > > > you need to do.
> > > > > Copy all the fread_functions to another function name
> > (stread_*)
> > > > > for example. Instead of passing *fp, make it pass char *.
> > > > >
> > > > > Change all reference to 'fp' to the passed string (we'll
> > > > call it str)
> > > > >
> > > > > The in boot_db instead of passing the fp, read the entire
> > > > area file into a
> > > > > string and pass it:
> > > > >               stat(strArea, &areafile);
> > > > >               area=calloc(areafile.st_size, 1);
> > > > >               fread(area, areafile.st_size, 1, fpArea);
> > > > >               fclose(fpArea);
> > > > >               area[areafile.st_size-1]=0;
> > > > >
> > > > > This makes for less file operations.
> > > > >
> > > > > Example function:
> > > > >
> > > > > void load_area(char *str)
> > > > > {
> > > > >     AREA_DATA *pArea;
> > > > >
> > > > >     pArea = calloc(sizeof(*pArea),1);
> > > > >
> > > > >     strcpy(pArea->file_name, stread_word(str));
> > > > >
> > > > >     pArea->area_flags = AREA_LOADING;
> > > > >     pArea->security = MAX_SECURITY;
> > > > >     pArea->builders = strdup("None");
> > > > >     pArea->vnum = top_area;
> > > > >
> > > > >     pArea->name = stread_string(str);
> > > > >     pArea->credits = stread_string(str);
> > > > >     pArea->min_vnum = stread_room_number(str);
> > > > >     pArea->max_vnum = stread_room_number(str);
> > > > >     pArea->age = 32;
> > > > >     pArea->nplayer = 0;
> > > > >     pArea->empty = FALSE;
> > > > >
> > > > >     if (!area_first)
> > > > >       area_first = pArea;
> > > > >     if (area_last) {
> > > > >       area_last->next = pArea;
> > > > >       REMOVE_BIT(area_last->area_flags, AREA_LOADING);
> > > > >     }
> > > > >     area_last = pArea;
> > > > >     pArea->next = NULL;
> > > > >     old_area=TRUE;
> > > > >     top_area++;
> > > > >     return;
> > > > > }
> > > > >
> > > > > No, here's an example of stread_*:
> > > > >
> > > > > char * stread_string(char *str)
> > > > > {
> > > > >    static char plast[MSL*2];
> > > > >    char c;
> > > > >    int pc=0;
> > > > >    do {
> > > > >       c = str[str_pos];
> > > > >       str_pos++;
> > > > >     }
> > > > >    while (c=='\n' || c==' ' || c=='\r');
> > > > >     /* while (isspace((int)c)); */
> > > > >
> > > > >     if (c == '~')
> > > > >      return &str_empty[0];
> > > > >    str_pos--; // we need to shove this back a character
> > > > >     for (;;) {
> > > > >        plast[pc]  = str[str_pos];
> > > > >        str_pos++;
> > > > >        switch (plast[pc]) {
> > > > >         case '\n':
> > > > >           pc++;
> > > > >           plast[pc] = '\r';
> > > > >           break;
> > > > >
> > > > >         case '~':
> > > > >           if (str[str_pos] == '\n' || str[str_pos] == '\r'){
> > > > >              plast[pc] = '\0';
> > > > >              return strdup(plast);
> > > > >           }
> > > > >        }
> > > > >        pc++;
> > > > >     }
> > > > > }
> > > > >
> > > > >
> > > > > Now, when you were using an fp, the OS keeps track of the
> > > > file location
> > > > for
> > > > > you.
> > > > > Nothing keeps track of the string position.  This is what I
> > > > use str_pos
> > > > for.
> > > > >
> > > > >
> > > > > This alone lowered my mud booting time from 20 seconds to 1.
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Chad Simmons [mailto:[EMAIL PROTECTED]
> > > > > > Sent: Friday, July 18, 2003 3:10 AM
> > > > > > To: Chris Winston Litchfield
> > > > > > Cc: [email protected]
> > > > > > Subject: Re: Simple Performance Speedup.
> > > > > >
> > > > > >
> > > > > >
> > > > > > --- "Chris \"Winston\" Litchfield"
> > <[EMAIL PROTECTED]> wrote:
> > > > > > > Tip of the day.
> > > > > > >
> > > > > > > fread_string and other fread_* functions are used a lot.
> > > > > > It would  make
> > > > > > > sense that they be as fast as possible.......  it is why
> > > > > > they are using HASH
> > > > > > > tables for string combining...
> > > > > > >
> > > > > > > So.. a tip of the day.
> > > > > > >
> > > > > > > in db.c at the top make a variable called "charptrsize" an
> > > > > > > int. in boot_db do: charptrsize = sizeof(char *);
> > > > > >
> > > > > > [snip]
> > > > > >
> > > > > > > Instant SPEEDup.  Remember each unneeded function call adds
> > > > > > a slight bit
> > > > > > > slowdown.
> > > > > >
> > > > > >
> > > > > > Firstly, if you are actually going to do this, you
> > should use a
> > > > > > const size_t not just an int, as it's not unsigned,
> > and it's not
> > > > > > going to change through
> > > > > > program execution.
> > > > > >
> > > > > > Secondly, you're focusing on the wrong area. If you
> > actually run
> > > > > > ROM through a profiler, you'll see that the places ROM spends
> > > > > > most of it's time is not in
> > > > > > fread_string. In fact, these are only typically called at
> > > > > > boot up, and when a
> > > > > > new player connects.
> > > > > >
> > > > > > If you want to look for things to optimize, start with the
> > > > > > update handlers. For example, creating a new linked
> > list for the
> > > > > > character data to quickly determine
> > > > > > which creatures are currently in a fight will save your
> > > > > > process a lot of time
> > > > > > when it does the violence update every second or so. That's
> > > > > > assuming you didn't
> > > > > > really want to clean things up, in which case an event queue
> > > > > > will really help
> > > > > > with a lot of the empty loops which occur throught
> > the ROM code.
> > > > > >
> > > > > > Just some suggestions,
> > > > > >
> > > > > > ~Kender
> > > > > >
> > > > > > =====
> > > > > > -----BEGIN GEEK CODE BLOCK-----
> > > > > > Version 3.1
> > > > > > GCS/L/C/O d-(+) s++: a-- C+++$>++++ UBLS++++$
> > > > > > P+++(--)$ L+++>++++ E--- W+>++$ N !o K? w(--) !O
> > > > > > M- !V PS+ PE(++) Y+ PGP->+ t+ 5 X+() R(+) tv+@
> > > > > > b++(+++) !DI+++ D G(-) e>+++$ h---() r+++ y+++
> > > > > > ------END GEEK CODE BLOCK------
> > > > > >
> > > > > > __________________________________
> > > > > > Do you Yahoo!?
> > > > > > SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
> > > > >
> > > > > --
> > > > > ROM mailing list
> > > > > [email protected]
> > > > > http://www.rom.org/cgi-bin/mailman/listinfo/rom
> > > > >
> > > >
> > > >
> > > > --
> > > > ROM mailing list
> > > > [email protected]
> > > > http://www.rom.org/cgi-bin/mailman/listinfo/rom
> > > >
> > > >
> > >
> > >
> > >
> > > --
> > > ROM mailing list
> > > [email protected]
> > > http://www.rom.org/cgi-bin/mailman/listinfo/rom
> > >
> >
> > --
> > ROM mailing list
> > [email protected]
> > http://www.rom.org/cgi-bin/mailman/listinfo/rom
> >
> >
>
>
>
> -- 
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom
>
> -- 
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom
>
>



Reply via email to