|
Posted by Richard Formby on 03/19/07 07:29
kenoli wrote:
> The following code is extracting all fields from all records from a
> mysql database that has about 250 records in it. Firefox takes over
> one minute to extract these records
Nope. It is not firefox extracting those records. It's your PHP script.
Firefox just displays what you throw at it.
> and display them in rows in a
> table using the code included below. Safari takes about 30 seconds.
> Even after the page displays, the scrolling is a little eratic.
>
> When I use another script to extract the same data and display the
> first and last names in one column, it takes about 3 seconds from
> start to finish. So I believe it is not the database or the server.
> I can only conclude it is the script.
Wrong conclusion but, first a hint: The PHP script runs on your server.
From here it takes 2.93 seconds (measured by firebug) to download the page,
which is about right for downloading 219KB from the other side of the
planet. That is from when the browser fires up the first request to you to
when the last byte arrives here. So, your server side stuff takes 2.93
seconds, minus the TCP/IP round-trip time, which would be a couple of
seconds. Pretty quick for building such a complex page.
It takes a further 15 (subjective) seconds to render (I have a Very Fast
computer). It's a browser problem, not a PHP one.
I think you have hinted at the problem above: "extract the same data and
display the first and last names in one column, it takes about 3 seconds ".
Render (not extract and download) one column as against many columns with
all sorts of stuff in them. You have just overloaded the browser.
To really convince yourself of this, use firefox to Save Page As to your
local file system. Then point firefox at that. No round trip to your PHP
script. No server at all, just straight HTML direct from the local file
system. Takes 15 seconds to render.
Before you go any further though sit down at your computer and try to
actually *use* that page.
250 rows of updatable data is *way* too much, by a country mile. It's way
beyond all the user interface guidelines out there. Too much information.
What is wrong with putting all that stuff in the "personal information" page
you have behind the scenes?
Consider phpMyAdmin: By default it only displays 30 rows and gives you the
option of scrolling to others. Even then if you want to do something complex
you have to drill down to the detail, which is not presented on, say, the
Structure tab.
--
Richard.
Navigation:
[Reply to this message]
|