Bug 65813 - php script slows down as a function is called repeatedly
php script slows down as a function is called repeatedly
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: php (Show other bugs)
1.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Phil Copeland
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-05-31 18:08 EDT by Need Real Name
Modified: 2007-04-18 12:42 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-08-05 17:00:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
php script (parse_test.php) (2.61 KB, text/plain)
2002-05-31 18:12 EDT, Need Real Name
no flags Details
first line of the test_register.txt file. Just duplicate this line 3000 times (133 bytes, text/plain)
2002-05-31 18:18 EDT, Need Real Name
no flags Details

  None (edit)
Description Need Real Name 2002-05-31 18:08:51 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc2) Gecko/20020510

Description of problem:
I have a php script that parses a file. The function parse_line() is called for
each line of the file. It starts at 0-1 sec per 100 lines. But as the file is
parsed, each 100 lines takes more and more time. I've tested the same script on
the same version of php on a Mandrake installation and it parses 3000 lines in
under a second. php script and the first line of the text file are attached.
Just make a new test file with 3000 lines of the same line.

Starting from your source rpm, I just build php  version 4.2.1 version and it
seems to perform very well (3 sec. for 3000 lines). The only difference is I
removed php-mysql package and the debug extensions. My suspicion is on the debug
extensions.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.open parse_test.php in a web browser
2.
3.
	

Actual Results:  Line: 100, Time: last 100: 1 total: 1
Line: 200, Time: last 100: 1 total: 2
Line: 300, Time: last 100: 1 total: 3
Line: 400, Time: last 100: 2 total: 5
Line: 500, Time: last 100: 3 total: 8
Line: 600, Time: last 100: 3 total: 11
Line: 700, Time: last 100: 3 total: 14
Line: 800, Time: last 100: 5 total: 19
Line: 900, Time: last 100: 4 total: 23
Line: 1000, Time: last 100: 5 total: 28
Line: 1100, Time: last 100: 6 total: 34
Line: 1200, Time: last 100: 7 total: 41
Line: 1300, Time: last 100: 6 total: 47
Line: 1400, Time: last 100: 8 total: 55
Line: 1500, Time: last 100: 7 total: 62
Line: 1600, Time: last 100: 9 total: 71
Line: 1700, Time: last 100: 9 total: 80
Line: 1800, Time: last 100: 9 total: 89
Line: 1900, Time: last 100: 10 total: 99
Line: 2000, Time: last 100: 11 total: 110
Line: 2100, Time: last 100: 11 total: 121
Line: 2200, Time: last 100: 11 total: 132
Line: 2300, Time: last 100: 13 total: 145
Line: 2400, Time: last 100: 13 total: 158
Line: 2500, Time: last 100: 13 total: 171
Line: 2600, Time: last 100: 14 total: 185
Line: 2700, Time: last 100: 14 total: 199
Fatal error: Maximum execution time of 200 seconds exceeded in 

Expected Results:  When I run the same script from a Mandrake installation
(php4.1.2) times are too small to be counted

Line: 100, Time: last 100: 0 total: 0
Line: 200, Time: last 100: 0 total: 0
Line: 300, Time: last 100: 0 total: 0
Line: 400, Time: last 100: 0 total: 0
Line: 500, Time: last 100: 0 total: 0
Line: 600, Time: last 100: 0 total: 0
Line: 700, Time: last 100: 0 total: 0
Line: 800, Time: last 100: 0 total: 0
Line: 900, Time: last 100: 0 total: 0
Line: 1000, Time: last 100: 0 total: 0
Line: 1100, Time: last 100: 0 total: 0
Line: 1200, Time: last 100: 0 total: 0
Line: 1300, Time: last 100: 0 total: 0
Line: 1400, Time: last 100: 0 total: 0
Line: 1500, Time: last 100: 0 total: 0
Line: 1600, Time: last 100: 0 total: 0
Line: 1700, Time: last 100: 0 total: 0
Line: 1800, Time: last100: 0 total: 0
Line: 1900, Time: last 100: 0 total: 0
Line: 2000, Time: last 100: 0 total: 0
Line: 2100, Time: last 100: 0 total: 0
Line: 2200, Time: last 100: 0 total: 0
Line: 2300, Time: last 100: 0 total: 0
Line: 2400, Time: last 100: 0 total: 0
Line: 2500, Time: last 100: 0 total: 0
Line: 2600, Time: last 100: 0 total: 0
Line: 2700, Time: last 100: 0 total: 0
Line: 2800, Time: last 100: 0 total: 0
Line: 2900, Time: last 100: 0 total: 0
Line: 3000, Time: last 100: 0 total: 0
Total: 3003 lines. Pass: 0. Fail: 3003, Time: 0

Additional info:
Comment 1 Need Real Name 2002-05-31 18:12:05 EDT
Created attachment 59165 [details]
php script (parse_test.php)
Comment 2 Need Real Name 2002-05-31 18:18:06 EDT
Created attachment 59166 [details]
first line of the test_register.txt file. Just duplicate this line 3000 times
Comment 3 Phil Copeland 2002-06-04 16:37:10 EDT
Ah bugger that would suck if it was the dbg extensions. 8/
I've been carefully getting that all ready for people to debug php with 

http://dd.cron.ru/dbg/

I've even got part of the dist setup so that you can debug away inside ddd
http://dd.cron.ru/dbg/gifs/ddd.snapshot1.gif

This is still under investigation though.

Phil
=--=
Comment 4 Phil Copeland 2002-08-05 17:00:55 EDT
It's the debugging module and I'd expect that as it's busy tracing and
maintaining state table/variable lists.

just set
    debugger.enabled = False
and restart the web server (you don't even need to comment out the
extension=dbg.so line)

The default for the debugging has been set to False for future referance.

Thanks

Phil
=--=

Comment 5 Phil Copeland 2002-08-05 17:02:16 EDT
Sorry, I meant to say "'set debugger.enabled = False' in /etc/php.ini"

Phil
=--=

Note You need to log in before you can comment on or make changes to this bug.