Topic One:

Optimizing FT. I know this was just briefly mentioned on the list. I would
like to get a discussion going on this. I'll play scribe for this and put it
into a document.

Note: I must say that I have not had any complaints yet about speed. But, I
am still in development so I am the only one hitting the server.


I am throwing these out as a basis for dialogue. Not all are FT specific. I
just want to discuss ways to speed up any FT sites. Please correct me if I
am wrong on some of these:

1) Index the DB. Most 'catalogue' systems are updated relatively
infrequently. So, it doesn't matter if it takes 3 seconds to do an INSERT or
UPDATE. We need the speed on the SELECTs. Figure out what fields you are
doing selects on and think about indexing them. Leon has stated that FT 2
uses more indexes so you change check the new build.sql file for ideas. Any
MySQL-specific issues?

2) MOD_PHP - install PHP as an Apache module instead of running it as a CGI
process. This should speed you up quite a bit. I am still trying to find a
good host who runs PHP as an Apache module. Most that I have spoken to only
run it as a CGI process. Can any one help here?  Also, if you run PHP as an
Apache module - could this crash the server if there is a problem with PHP?
Is this why hosts are reluctant to do this?

3) Removed unneeded comments. Comments in compiled languages (like C++,
Java) are removed during compilation. So, you could write a book in the
comments field and it would not adversely affect the size/speed of the OBJ
or EXE. However, PHP is a parsed language. Every comment line is one more
line that the parser have to read. We should remove comments which do not
add to the readability of the code. In my opinion, the comment blocks at the
top should be cut down. I have removed everything except the copyright, name
of file, and version number. If you add up all the comments from all the
include files, it can be quite a lot of extra lines.

4) The Language and ScreenInfo files: it seems a waste to read in the whole
of these files and define a gazillion variables that we probably do not
need. Is there a way of changing this? For FT 1.x? I was thinking of
something simple like a SWITCH statement allowing us to only define the vars
we need for the particular screen we are building. Any other ideas? Is this
a big issue?

5) For what it is worth: I changed the layout a bit. I changed the left
side. As part of this, I took out all the <BR>s and made <TR>s instead. It
could be my imagination, but I could swear that the screen draws noticeably
quicker. Any reason for this?

6) Images: always use the height/width tags if possible. If you do, the
browser can allocate the needed space and complete rendering the table.
Otherwise, it has to calculate the size before it even proceeds rendering
the next part of the table.

7) CSS - I think we should keep the Stylesheet file but we should not
include it in everypage. We should use it as an external stylesheet. We can
change the code to reference the file in the IMAGES_DIR (or where ever). The
benefit: The way it is currently done: the same stylesheet info has to be
passed over the wire with every request. With an external stylesheet, the
stylesheet file is downloaded to the browser's cache and used from the
client. Therefore, it is only passed over the wire ONCE. Stylesheets are not
that big, but all the little things add up.

thoughts, additions, flames?




------------------------------------------------------------
To subscribe:    [EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Site:            http://www.working-dogs.com/freetrade/
Problems?:       [EMAIL PROTECTED]

Reply via email to