Rendering Performance

Theme, template, layout, or image issues

Rendering Performance

Postby ScratchMonkey » Thu Nov 09, 2006 3:32 am

I use the GuildBank button a lot to see who has what. (My guild is very big on sharing.) The performance is pretty sluggish, taking about 12 seconds to render in Mozilla. I timed the SQL queries using the command line mysql utility and that takes about 1 second. I thought perhaps the PHP that constructed the page was slow, so from the server I ran "time wget -nd http://matureasskickers.net/wowroster/guildbank.php" and measured 1.5 seconds.

I then turned off images in Seamonkey and found the rendering speed pretty close to that 1.5 seconds (subjective). So I think the big delay in getting the full table is in sucking down all the images.

A big part of this is not the actual rendering of the images, but the re-computing of the table dimensions, which has to wait for the images to arrive to get the dimensions set right.

To speed that up, I recommend adding width and height attributes to all HTML img tags. I looked up how to do that in PHP and found that there's a getimagesize API that can extract an image file's dimensions for just this kind of application. It might even be possible to cache these in a table to eliminate the need to re-parse the image files with each query. The caching could be done with a utility button on the administration page.

http://us3.php.net/getimagesize
User avatar
ScratchMonkey
WR.net Expert
WR.net Expert
 
Posts: 212
Joined: Wed Jul 05, 2006 4:32 pm
Location: San Pablo, CA

Rendering Performance

Postby ScratchMonkey » Thu Nov 09, 2006 3:54 am

Some more data. I tried pulling just the raw page (no images) from my Linux box using the above wget and it takes about 5.5 seconds. So 4 seconds is used for transferring the HTML file. I hard-coded width and height attributes of 40 so that includes the additional verbiage for all the img entities.
User avatar
ScratchMonkey
WR.net Expert
WR.net Expert
 
Posts: 212
Joined: Wed Jul 05, 2006 4:32 pm
Location: San Pablo, CA

Rendering Performance

Postby zanix » Thu Nov 09, 2006 5:02 am

Well, the images are 40x40 jpg files

And the css for every icon is set to 38x38, so they are already set

Maybe adding pagination would help?
Last edited by zanix on Thu Nov 09, 2006 5:02 am, edited 1 time in total.
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Rendering Performance

Postby ScratchMonkey » Thu Nov 09, 2006 5:54 am

Thanks, I hadn't thought to look for CSS, as I'd never seen the attributes put there before. (I'm still a big green to CSS.)

I tried enabling gzip on the HTML (using ob_start) but I'm not sure if either wget or curl negotiates to use it, and the time definitely doesn't change. Doing it with ob_start is slightly less optimal than mod_gzip (which I don't have installed and would have to go find) since it doesn't compress until the page is composed, while mod_gzip does it during buffering and streams right away, allowing overlapped I/O. But I'm sure it can't take 4 seconds to gzip the page.

BTW, since I use the guildbank feature primarily as a way to search for an item, it might be nice to have an addon that does just that, and searches bags, bank, and email. Often I'm looking for something on one of my mules and can't remember who's holding it or if it's in a mailbox somewhere.
User avatar
ScratchMonkey
WR.net Expert
WR.net Expert
 
Posts: 212
Joined: Wed Jul 05, 2006 4:32 pm
Location: San Pablo, CA

Rendering Performance

Postby zanix » Thu Nov 09, 2006 10:07 am

Change the display option in Roster config to Inventory view, which changes the link to guildbank2.php

This will look like this http://cvsroster.homeip.net/roster1x/tr ... dbank2.php
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Rendering Performance

Postby ScratchMonkey » Thu Nov 09, 2006 10:33 am

Ok, but what does that buy me?
User avatar
ScratchMonkey
WR.net Expert
WR.net Expert
 
Posts: 212
Joined: Wed Jul 05, 2006 4:32 pm
Location: San Pablo, CA

Rendering Performance

Postby zanix » Thu Nov 09, 2006 10:38 am

I dunno, sorry...
I meant it as a suggestion to page load times
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Rendering Performance

Postby ScratchMonkey » Thu Nov 09, 2006 11:11 am

This runs in 2.3 seconds from a remote connection:

time wget -S --header "Accept-Encoding: gzip" -nd http://matureasskickers.net/wowroster/guildbank.php

I'm not sure why Seamonkey is taking so long, with images disabled. I suspect it's not sending the encoding header.

I looked at the received file. Without gzip, the HTML is 1.4 megabytes. With gzip, it's only 124 kbytes.
User avatar
ScratchMonkey
WR.net Expert
WR.net Expert
 
Posts: 212
Joined: Wed Jul 05, 2006 4:32 pm
Location: San Pablo, CA


Return to Appearance

Who is online

Users browsing this forum: No registered users and 1 guest

cron