ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-dev
php-dev
#50086 [Opn->Csd]: [PATCH] - Avoid invoking setitimer when timeouts have been disabled
by dmitry other posts by this author
Nov 5 2009 2:39AM messages near this date
#50086 [NEW]: [PATCH] - Avoid invoking setitimer when timeouts have been disabled | #50085 [NEW]: exception message does not allow hex 0
ID:               50086
 Updated by:       dmitry@[...].net
 Reported By:      yoarvi at gmail dot com
-Status:           Open
+Status:           Closed
 Bug Type:         Performance problem
 Operating System: Solaris 5.10 (SPARC)
 PHP Version:      6SVN-2009-11-05 (SVN)
 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2009-11-05 09:11:18] yoarvi at gmail dot com

Description:
------------
When compiled with #ifdef ZTS, the setitimer calls in
zend_unset_timeout show up as a performance hotspot even when 
max_execution_time and max_input_time are set to 0 in php.ini.

(Originally posted to the internals list -
http://marc.info/?l=php-internals&m=125689761124706&w=2)

Reproduce code:
---------------
The following patch avoids invoking zend_unset_timeout (and thereby the
expensive setitimer call within) when timeouts have been disabled via
settings in php.ini


diff -r d0dddebae3a2 main/main.c
--- a/main/main.c	Mon May 04 18:11:50 2009 +0200
+++ b/main/main.c	Fri Aug 28 17:35:25 2009 +0530
@@ -1602,7 +1602,9 @@
 	} zend_end_try();
 
 	zend_try {
-		zend_unset_timeout(TSRMLS_C);
+		if (EG(timeout_seconds) != 0) {
+			zend_unset_timeout(TSRMLS_C);
+		}
 	} zend_end_try();
 }
 
@@ -1702,7 +1704,9 @@
 
 	/* 12. Reset max_execution_time */
 	zend_try {
-		zend_unset_timeout(TSRMLS_C);
+		if (EG(timeout_seconds) != 0) {
+			zend_unset_timeout(TSRMLS_C);
+		}
 	} zend_end_try();
 
 #ifdef PHP_WIN32


Expected result:
----------------
Improved multi-threaded performance.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=50086&edit=1
Thread:
Yoarvi At Gmail Dot Com
dmitry

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved