ID: 11018
Updated by: derick
Status: Open
Bug Type: Performance problem
Operating system: 
PHP Version: 4.0.4pl1
Assigned To: 

I suggest using preg_replace and try to splitup the $bib variabele into smaller parts 
(i.e. per line).
Can you see if this works better for you?


Previous Comments:

[2001-05-22 09:45:22] [EMAIL PROTECTED]
My publication page
( is generated
with PHP. Part of the generation process includes the
following regular expression substitutions:

$bib = ereg_replace("([0-9]+)--([0-9]+)", "\1-\2",$bib); 
$bib = ereg_replace("{((['`]|w)+)}", "\1", $bib);

$bib is a variable containig about 20K of text generated by
a BibTeX style. Everything worked fine with PHP 3, but since
I installed PHP 4, the page is output in >20 seconds.
Indeed, there where other 10 substitutions, and initially
the page wouldn't simply display because of server timeout.
I changed whenever possible ereg_replace to str_replace, but
of course the two substitutions above need regular
expressions. They increase the page serving time of about
15s. Computation time was negligible with PHP 3.

The strange thing is that the page is _serverd_ slowly. One
would expect that there is a long wait, and then the page is
served all at one time. Instead, there is a long wait, and
then the page is served slowly. Eliminating the two regular
expressions above solves the problem (but serves the wrong
page 8^).


ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to