PDA

View Full Version : PHP Getting data is fast, but Flash displaying php data is slow, why?



para2sakura
December 11th, 2009, 12:13 AM
Hi guys,

This is my first post. I have a problem in flash and php, hope you guys can help.

In my database(mysql), I have a table which has 50k data(rows/records).

I do a test using firebug, after playing the game, the call to load_score.php and save_score.php is around 380ms (millisecond).

The save_score.php just a normal inserting, nothing much. The load_score.php, I use this query:

SELECT name, score
FROM `highscores`
WHERE id =1
LIMIT 0, 10

- The result returns 10 rows
- the query returns in 0.0005 seconds (tested using phpmyadmin)
- I echoed the data back to flash.

But on my game (flash), it tooks 11 seconds(count manually) to load and save the score. Why the time differences is so big?

Could it be the problem when Flash received php data, the process to display is slow?? :h::h::h:

Are there any others reasons on why the displaying take longer time??

(If you need more information, please let me know)

Dhryn
December 13th, 2009, 08:20 PM
Sorry for the late reply, don't know if you are still stuck with this but I will have a go.

Firstly, have you tried echoing the times in flash from the when the request is sent to the server to when it has returned, as it could be a problem with flash being delayed before the request is sent. Seeing your code for this might help.

Secondly, what method are you using to send the requests, as you would expect, there are many ways you can go about this and what version of action script are you using?