Re: [PHP-DEV] Patches for a few Date/time related bugs

2010-03-02 Thread Arvind Srinivasan
Hi Derick, When you have some time, please could you review the patches I've added to each of the following date/time-related bugs. If the fix for 49778 is applied, then I'll need to change one of the other test cases (50559) that prints the days value of DateInterval objects.

[PHP-DEV] Re: Patches for a few Date/time related bugs

2010-01-27 Thread Arvind Srinivasan
and DatePeriod) Thanks, Arvi On Wed, Jan 20, 2010 at 9:47 PM, Arvind Srinivasan yoa...@gmail.com wrote: Hi, I've updated each of the following bug reports http://bugs.php.net/bug.php?id=50475 - DateTime::setISODate followed by DateTime::setTime http://bugs.php.net/bug.php?id=49059

Re: [PHP-DEV] Patches for a few Date/time related bugs

2010-01-27 Thread Arvind Srinivasan
Thanks Derick. Please could you point me to info on how the timelib_timezone_db_data (in ext/date/lib/timezonedb.h) is generated. /* This is a generated file, do not modify */ const unsigned char timelib_timezone_db_data_builtin[257664] = { (A couple of the timezone related bugs I looked at

[PHP-DEV] Patches for a few Date/time related bugs

2010-01-20 Thread Arvind Srinivasan
Hi, I've updated each of the following bug reports http://bugs.php.net/bug.php?id=50475 - DateTime::setISODate followed by DateTime::setTime http://bugs.php.net/bug.php?id=49059 - DateTime::diff() repeats previous sub() operation http://bugs.php.net/bug.php?id=49904 - DateTime::modify('last

Re: [PHP-DEV] [PATCH] - Improving multi-threaded performance by propagating TSRMLS_C

2009-12-03 Thread Arvind Srinivasan
(2) If the number of occurrences is large, then rename the function (prefix with _) and add a macro that passes TSRMLS_C e.g. -ZEND_API void zend_hash_destroy(HashTable *ht); +ZEND_API void _zend_hash_destroy(HashTable *ht TSRMLS_DC); +#define zend_hash_destroy(ht) _zend_hash_destroy((ht)

Re: [PHP-DEV] [PATCH] - Improving multi-threaded performance by propagating TSRMLS_C

2009-12-01 Thread Arvind Srinivasan
hi johannes, I'm not too happy about hiding the TSRM macro with another macro as it makes reading the code harder. When writing code I want to spot easily whether my function needs TSRM or not. When adding such a macro that should be done for making the code better readable, not worse.

[PHP-DEV] [PATCH] - Improving multi-threaded performance by propagating TSRMLS_C

2009-11-30 Thread Arvind Srinivasan
When running a benchmarking workload on PHP that was configured with multi-threading support (--enable-maintainer-zts) I noticed that pthread_get_specific is invoked many times during the processing of a request. PHP code invokes TSRMLS_FETCH() (which ends up invoking ts_resource_ex) in a number

Re: [PHP-DEV] [PATCH] - Improving multi-threaded performance by propagating TSRMLS_C

2009-11-30 Thread Arvind Srinivasan
Hi Pierre, slow (as you noticed). However it can't be done in 5.3 as it will break the ABI. I noticed that a recent fix (http://bugs.php.net/bug.php?id=49936) added TSRMLS_DC to an API in 5.3.

Re: [PHP-DEV] [PATCH] - Improving multi-threaded performance by propagating TSRMLS_C

2009-11-30 Thread Arvind Srinivasan
It was reverted. ah..i missed that. sorry. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] autoconf version check on trunk?

2009-11-27 Thread Arvind Srinivasan
There was some discussion on the version (2.13 vs newer) of autoconf to use for trunk but I'm not sure whether there was any consensus. It looks like autoconf2.13 can't be used with trunk and therefore the autoconf version check inside build/buildcheck.sh needs to be updated. I get the following

[PHP-DEV] Question about buffer size calculation in _php_stream_copy_to_mem_ex

2009-11-19 Thread Arvind Srinivasan
I see the following in _php_stream_copy_to_mem_ex in main/streams/streams.c int step = CHUNK_SIZE; int min_room = CHUNK_SIZE / 4; (..stuff deleted..) /* avoid many reallocs by allocating a good sized chunk to begin with, if * we can. Note that the

Re: [PHP-DEV] Re: Stuck debugging a PHP6 string--unicode--string conversion problem on Solaris (SPARC)

2009-11-17 Thread Arvind Srinivasan
thanks. i've updated the patch in the bug report to use WORDS_BIGENDIAN. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] [PATCH] - Improving multi-threaded scalability by using emalloc/efree/estrdup instead of malloc/free/strdup in virtual_cwd APIs

2009-11-17 Thread Arvind Srinivasan
Using malloc/free in a multi-threaded process limits its scalability because of the process-wide lock inside malloc/free. The scalability of the PHP engine in a multi-threaded process can be improved by reducing the use of malloc/free/strdup and instead using emalloc/efree/estrdup wherever

[PHP-DEV] Re: Stuck debugging a PHP6 string--unicode--string conversion problem on Solaris (SPARC)

2009-11-16 Thread Arvind Srinivasan
I think I've found the cause of the problem. I have created a bug and attached a patch to http://bugs.php.net/?id=50189 Arvi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Re: [PATCH] - Change how zstr values are passed to varags functions that use %v/%R (for PHP6)

2009-11-16 Thread Arvind Srinivasan
Based on feedback (http://forums.sun.com/thread.jspa?threadID=5415962tstart=00) from the Sun compiler folks, it seems that the following patch is necessary for PHP6 (trunk). I searched for all occurrences of %v and %R in the PHP6 tree and added a .v to all the zstr values passed to those

[PHP-DEV] Stuck debugging a PHP6 string--unicode--string conversion problem on Solaris (SPARC)

2009-11-13 Thread Arvind Srinivasan
Hi, I need some help debugging a test failure (./ext/spl/tests/DirectoryIterator_getBasename_basic_test goes into an infinite loop) on Solaris 10 (SPARC) with PHP6 trunk. I've narrowed the problem down to a difference between what zspprintf() converts to unicode and is then subsequently

[PHP-DEV] [PATCH] - Change how zstr values are passed to varags functions that use %v/%R (for PHP6)

2009-11-12 Thread Arvind Srinivasan
When running 'gmake test' on my PHP6 tree on Solaris 10 (SPARC), I noticed that a number of test failures were caused by the presence of non-ASCII characters in function names etc. For example: sapi/cli/php tests/classes/__set__get_001.php Setting [a] to 100 OK! Getting [a] Returning: 100 Setting

Re: [PHP-DEV] Feedback requested on using #defines to improve the performance of the TSRMG macro

2009-11-05 Thread Arvind Srinivasan
Does the GLOBALS_ID_BASE idea work?  In ts_allocate_reserved_id(GLOBALS_ID_BASE+1...) each extension would anyway need to reserve an increment to avoid clashes.  Also, why is I didn't really try using this. When I added it, I thought it might be useful for modules that live outside the PHP

Re: [PHP-DEV] Submitting performance patches

2009-10-31 Thread Arvind Srinivasan
thanks pierre. i'll do that. arvi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [PATCH] - Check configured error level before reporting E_NOTICE messages

2009-10-31 Thread Arvind Srinivasan
This is a bad idea, because the error handler does other things as well. If the error reporting level indicates that the user is not interested in E_FOO, why would there be an expectation that zend_error be invoked for E_FOO messages? Arvi -- PHP Internals - PHP Runtime Development Mailing

[PHP-DEV] Submitting performance patches

2009-10-30 Thread Arvind Srinivasan
Hi, For the past few months I've been working on improving PHP performance primarily on CMT hardware on Solaris. I've used Sun Studio C++'s collector/analyzer to identify the performance bottlenecks in PHP when running a web-based ecommerce-site workload. Over the next few weeks I hope to post my

[PHP-DEV] [PATCH] - Avoid invoking setitimer when timeouts have been disabled

2009-10-30 Thread Arvind Srinivasan
When compiled with #ifdef ZTS, the setitimer calls in zend_unset_timeout show up as a performance hotspot even when I'd set max_execution_time and max_input_time to 0 in php.ini. I've attached a patch for review that avoids invoking zend_unset_timeout (and thereby the expensive setitimer call

[PHP-DEV] [PATCH] - Use pool_malloc/pool_free instead of MALLOC/FREE in the NSAPI plugin

2009-10-30 Thread Arvind Srinivasan
The PHP NSAPI plugin for Sun Web Server could be made more efficient by using the pool_* APIs that are exposed by Sun Web Server's NSAPI interface. The attached patch avoids invoking pthread_getspecific by using pool_malloc/pool_free instead of MALLOC/FREE. thx, arvi diff -r ababbd629dca

[PHP-DEV] [PATCH] - Remove unnecessary strdup calls in the NSAPI plugin for PHP

2009-10-30 Thread Arvind Srinivasan
Please review the attached patch which removes unnecessary strdup calls in PHP's NSAPI plugin for Sun Web Server. The strings are unaltered in the SG(request_info) structure so there isn't any need to strdup them. thanks, arvi diff -r 94f02183a175 sapi/nsapi/nsapi.c --- a/sapi/nsapi/nsapi.c

[PHP-DEV] [PATCH] - Avoid unnecessary strlen in PHP's NSAPI plugin

2009-10-30 Thread Arvind Srinivasan
Please review the attached patch which avoids an unnecessary strlen call (in the NSAPI plugin for PHP) by using php_register_variable_safe instead of php_register_variable. thanks, arvi diff -r 64f24a22f518 sapi/nsapi/nsapi.c --- a/sapi/nsapi/nsapi.cWed Aug 26 17:33:06 2009 +0530 +++

[PHP-DEV] [PATCH] - Use pool_strdup instead of STRDUP in the NSAPI plugin for PHP

2009-10-30 Thread Arvind Srinivasan
The STRDUP macro in NSAPI ends up invoking pthread_get_specific each time. Since the PHP NSAPI plugin has access to the pool member of the Session variable, it can use pool_strdup instead of STRDUP. Please review the attached patch that uses pool_strdup instead of STRDUP thereby reducing the

[PHP-DEV] [PATCH] - Add optional configuration directive to skip ini value processing in obj.conf

2009-10-30 Thread Arvind Srinivasan
sapi/nsapi.c includes logic - nsapi_php_ini_entries() - for populating PHP's ini table with key/value pairs from Web Server's obj.conf file. This processing is unnecessary overhead for those Web Server configuration where the obj.conf files only contain standard Web Server pblock entries which