Re: PHP to C translator
| From: | Rouvas Stathis | Date: | Thu, 06 Jul 2000 13:09:29 +0000 |
| Subject: | Re: PHP to C translator | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5206@lists.php.net to get a copy of this message | ||
Well, the scripts do not iteract with a database.
They read a some text files from disk, do some calculations and output
some more text files to disk.
The calculation part is super-fast.
The output part is super-fast also.
BUT, the reading part from the text files is painfully slow....
For a text file of 350MB, the script run from PHP3 takes about 1.5h.
For the same text file, the script run from PHP4 takes about 30m. (wow,
that *is* an improvement, 300%).
All files are local to the machine.
Judging from the HDD led activity (yes, not a very reliable indicator) I
think it can be done faster.
I haven't tried the Zend optimizer, yet.
I'm running on SuSE 6.4, AMD-K7/500, HDD-UDMA66, 256MB RAM.
Any more ideas?
Thank you fro your time,
-Stathis.
Richard Lynch wrote:
>
> In article <39635EC0.811CD793@di.uoa.gr>, rouvas@di.uoa.gr (Rouvas
> Stathis) wrote:
>
> > I have written a bunch of PHP3 scripts that run in stand-alone mode
> > (cgi).
> > All goes extremely well.
> > Unfortunately they take an inordinate ammount of time to finish.
>
> What do the scripts do?...
> What part of the scripts is taking all the time?
> Do some metering and find out where all the time is going...
> The Usual Suspects:
> Opening database connection over and over in one script.
> Long loops to iterate through stuff an SQL query could have filtered.
> Creating buttloads of small, silly class objects because you like OO.
>
> > I haven't tried PHP4 yet, but does anyone know if a translator from PHP
> > to C in a Linux environment is available?
>
> I don't think any such beast exists...
>
> The closest would be the forth-coming Zend compiler...
>
> There's a Zend Optimizer (free) that might help in PHP4...
>
> You may run across documentation for a pre-tokenizer in php3 (php
> --help). Don't bother with it. It doesn't make it faster: It doesn't
> even work any more. The PHP team thought it would help speed things up to
> tokenize (the first step of compilation) but it didn't really help, so
> nobody keeps that code working.
> --
> Richard Lynch | If this was worth $$$ to you, buy a CD
> US Customer Support Director | from one of the artists listed here:
> Zend Technologies USA | http://www.L-I-E.com/artists.htm
> http://www.zend.com | (this has nothing to do with
> Zend, duh!)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
+-----------------------------+
|Rouvas Stathis |
|University of Athens |
|Department of Informatics |
|http://www.di.uoa.gr/~rouvas |
|rouvas@di.uoa.gr |
+-----------------------------+