Newsish Type Thing

June 2, 2004 @ 11:24:04
Rated: G

The last few weeks have been quite busy. There are so many things going on that it's hard to sometimes keep track of them all. Luckily I have been doing more planning of just how things should go and they have been working along my ever-so-loosely laid plans. I present the following.

World of Warcraft: Amanda and I were accepted into the World of Warcraft (WoW) beta just over a month ago. We are happily to say, very addicted. Her main character is an Elf Warrior Female named "Arseisis", and my two characters are a Human Paladin Male named Djspaceg and an Undead Rogue Female named SCSI. I have been spending a lot of my time in the game exploring the different lands and finding neat stuff along the way. I'll soon build a WoW section onto this site to share some of my neater findings. Complete with screenshots, descriptions and maybe even some stories.

SQL Menu: If you are truly on the ball you noticed a slight change to the menu on the left. This is because I recently recoded it yet again. Now the HTML code that makes it up is simply an unordered list for each of the categories. Each menu item is a List item. The CSS on the page and in the theme files makes it look like a table and float on the left side. Each theme does other specific custom things to it as well. The benefit to this is it is now much smaller code and less explicitly defined IDs and Classes. Smaller code == Faster Load. Now taking the aforementioned into consideration. I also converted the menu to a SQL Database. Now its much more advanced than you are thinking. First off it is NOT linear. so record insertion order doesn't matter (it dun matter what order I add the menu items or categories to the database.) Secondly, the database data has a series of sort order priority columns, parent category columns, and identifier columns; this in addition to the obvious: name link url, description, new, and disabled columns. Now, the database is parsed by a CGI script that loads the data into a 4 dimensional hash (hash of a hash of a hash of a hash) basically an array with key reference names. I.E. %Menu->Category->Item->Name. Once the data has been loaded into the hash, the data is sorted in two different directions, then printed with all the right information it is supposed to have all with correct code and any extra options. Here again I am telepathic and know what you are thinking. You are thinking that would be so incredibly slow why would he do something so complicated unprovoked? Well Your wrong and I'll tell you why. See the menu used to be stored in a plain old HTML file that with SSI (Server Side Includes) was included into every page as it was being sent out. The speed problem with this is it has to read the whole thing off the hard drive. So the needle/arm on the drive has to stop reading whatever else its doing, then go grab the menu then go back to what it was doing, for every single page load. Quite a lot huh? Oh yes it is. I'll continue. Please, by all means! Now that the data comes from a database, the information is stored in RAM while the MySQL server is running, access time is usually in under 0.02 seconds which is really quick. Parsing and loading into the 4D Hash takes literally three instants (Also quite fast.) So benefit: lass hard drive reads, smaller RAM footprint, faster processing time, quicker load time. I rest my case.