Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 360voice.com
 XML/APIs
 Script Load Times

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List Insert Smilie
   
Message:

* HTML is OFF
* Forum Code is ON

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Fafhrdd Posted - May 05 2008 : 06:13:30 AM
I have determined that my script slow downs are coming from the code used to get GT tiles.

I have done several things to reduce this waiting time to load gamer tiles and it did get MUCH better however I am stuck in reducing the times even futher.

First what is the best way to get the GT tile? I am using the API: http://www.360voice.com/api/gamertag-profile.asp?tag=

I am also loading two other APIs:

http://www.360voice.com/api/challenge-details.asp?id=
and
http://www.360voice.com/api/challenge-vitals.asp?tag=

Is there a quicker and easier way to load the GT tile.

I found the issue is with the loading of the XML files for this site...

The first two XML loads are really nothing: I am loading the Challenge Vitals only once (so no big deal here) and I am loading the Challenge Details for all hosted challenges. So even if I have played in 30 challenges it is only loading the details for the 15 that I hosted. So far its no big issue.

Enters in the gamer tile... The only way I can figure to get the GT tile URL is to load the API for http://www.360voice.com/api/gamertag-profile.asp?tag= and get the "tile" tag.

When loading 50 tiles per page it does not create a huge issue however it the user wants to see all, say 100+ users the script takes way too long.

Is there a better way to obtain the gamer tile?

Also I notice on all of this sites leaderboards the tiles load up AFTER the script has finished. So the script is done in a few seconds and THEN the gamertag tiles start to appear when the broswer downloads them. the way my script runs is that all the Gamertag tiles are loaded before the script is done loading. So when the page appears all the gamertag tiles show up at once.

I think this is because my script writes the HTML code and table tags via the Response.Write command.

I am just lost, if I remove all the gamer tile code it speeds the runtime up by about 10 times. I think the issue is with loading all those XMI files for each user to get the gamer tile.

Any help?
4   L A T E S T    R E P L I E S    (Newest First)
Fafhrdd Posted - May 06 2008 : 11:11:22 AM
I found out what was wrong (I think)!!!

After thinking about it, I checked the image size to the GT tiles. After seeing they are less then 7k a piece. I determined that even 100 of them (100 X 7k = 700k) it should not take that long to load the page.

After !numerous! tests I determined the issue was with caching the images. I forced the page to stop using cache and it seems to work 9 BILLION times better.

So either I fixed the issue or MS site just sped up just when I tested it. We shall see tonight :)
Fafhrdd Posted - May 06 2008 : 08:39:19 AM
quote:
Originally posted by ChangeAgent

So when you say loads the page with the 100+ tiles, are you talking about the straight XML render or the HTML render?

Because the XML shouldn't be THAT slow... but asking Xbox.com to load up those tiles can sometimes cause delay... I see this all the time when I am working with any URLs that come from xbox.com... user tiles or game tiles.



I am taking about the HTML rendered image. You are correct if I grab all the XML data and store it in my array it takes a matter of seconds and the script is done. However if I decide to use that XML data (the URL to the image) and place it in a <IMG> tag is then slows EVERYTHING down.

It seems like my script is waiting for each image to download before it continues on. It makes the script time jump up greatly however when I view V360 leaderboards I can see the images are loading after the script runs. With my page all the images show up at once, since the script waited for each image to download.

I am trying to figure out how to do it the way this site does. right now I am just making my ASP script write the HTML code via Response.write command with a For....Next statement.

Something like this:


For h=0 to (totalusercount-1)  

Response.write ("<td class=""rank"">  #" & ranknum & "</td>
  <td><img width=""32"" class=""tile"" src=""" & allData(5,h)
 & """></td>  <td><nobr>" & 
"<a href = ""http://www.360voice.com/tag/" & allData(1,h) & """>"
 & allData(1,h) & "</a></nobr></td>  <td class=""active"">"
 & allData(0,h) & "</td>  <td> <a href=""http://www.360voice.com/challenge/" 
& allData(3,h) & """ >" & allData(2,h) & "</a></td>  <td>" & 
allData(4,h) & "</td>  </tr>")  


This writes one line in my table for each user. The allData(5) holds the URL to the user tile. If I remove the AllData(5) from my script it loads up 10 times quicker. This proves that the loading of the GT tile slows everything down and not the storing of the XML data (since it is still being stored).
ChangeAgent Posted - May 05 2008 : 7:59:03 PM
So when you say loads the page with the 100+ tiles, are you talking about the straight XML render or the HTML render?

Because the XML shouldn't be THAT slow... but asking Xbox.com to load up those tiles can sometimes cause delay... I see this all the time when I am working with any URLs that come from xbox.com... user tiles or game tiles.
Fshguy Posted - May 05 2008 : 11:02:57 AM
I haven't done this myself yet. You could have a javascript for each tile image that calls a web function on your site that gets the tile info and then load the tile after the page is loaded on client side. I hope this makes sense?

I'm not sure if you have some type of javascript event that might be holding you up? I'm limited on what I can see at work because Live is blocked.

360voice Community © 2006 360voice.com Go To Top Of Page
Snitz Forums 2000