|
Posted by kenoli on 03/19/07 16:43
Thanks for all the great help on this, particularly pointers for how
to time my scripts and separate out database and scripting time from
renering time. I think it is clear that it is a browser issue and
that I am just expecting too much from the browser. I'm anxious to
try the config change on firefox that AHO suggested; Firefox has been
generally running very slow for me.
Richard, thanks for noting my careless use of language here. I do
know that the script is processed server side and got distracted by my
own subjective sense that the browser is "doing" it. Of course it is
a rendering problem. I just installed Firebug and haven't learned to
use it. It is clear that it will be a useful tool here.
Incidentally, I copied and pasted the source code for the loaded page
into an html document and, without any php operations, the html took
nearly two minutes to load in Firefox the way it is operating on my
computer, even longer than when the html was fed to it by the php
script.
So . . . proof positive, a browser renering problem. I guess I am
going to have to use some pagination. I set it up this way as the
person I was doing this for is used to browsing through and editing
huge amounts of data in table format in Excel and other software and
likes to look at it this way. I guess he'll have to bite the button
and be patient with the browser or settle for pages.
I have been reading up on AJAX and it seems like there are some
possibilities here, as well.
This has been a good learning experience for me. Thanks for the time
everyone has taken to help me understand this.
A few last questions related to some syntax issues someone brought
up.
1. I am a bit confused when to use curly braces around array values
(e.g. {$row['email']}). Sometimes a script seems to demand it (things
won't work unless I do) and sometimes a script won't work unless I
remove them. I don't really understand the standard here.
2. Also, I've started using single quotes consistently inside of
array brackets (['email']) thinking this is good form. Is this true?
I notice a lot of people leave them out. I don't see much consistency
here.
3. I'm told to generally use single quotes in php scripts when
surrounding string data as this save the time it takes for the script
to look for variables to render. Is this true?
4. I also notice that html scripts seem to use double quotes around
attribute values and have followed this apparent convention. Is there
any issue here?
Thanks
--Kenoli
On Mar 19, 12:29 am, "Richard Formby" <r...@invalid.com> wrote:
> 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]
|