From:
Operating system: Windows
PHP version: 5.3.3
Package: cURL related
Bug Type: Bug
Bug description:php_curl.dll, php_http.dll take 300ms to initialize
Description:
------------
both php_curl.dll and php_http.dll (linked with libcurl) are really slow to
initialize. on a machine where `php -n /dev/null` or `php -n -m` takes
~70ms to complete, `php -n -d extension_dir=/... -d extension=php_curl.dll
/dev/null` (or php_http.dll) uses above 300ms.
seen this on multiple hosts ranging from xp sp2 to server 2003 r2 sp2.
5.2 is not affected which makes me believe it is related to the pooling
functionality added in 5.3.
Test script:
---------------
run this with native PHP in the MSYS shell:
: ${PHP53:=/c/Webserver/Apache2.2/php-5.3}
: ${PHP52:=/c/Webserver/Apache2.2/php-5.2}
for p in $PHP53 $PHP52; do
for d in '' php_curl.dll php_http.dll; do
echo ${p##*/} using ${d:-nothing}
time $p/php -n -d extension_dir=$p/ext/ ${d:+-d extension=}$d
/dev/null
done
done
Expected result:
----------------
php_curl.dll / php_http.dll should add at max 100ms each, or at least the
documentation should mention prominently the consequences of loading these
libraries. i've read pecl_http's and php_curl's documentation, and found
no mention of a way to disable the time-consuming functionality.
Actual result:
--------------
php-5.3 using nothing
real 0m0.078s
user 0m0.015s
sys 0m0.016s
php-5.3 using -d extension=php_curl.dll
real 0m0.500s
user 0m0.000s
sys 0m0.015s
php-5.3 using -d extension=php_http.dll
real 0m0.516s
user 0m0.000s
sys 0m0.015s
php-5.2 using nothing
real 0m0.078s
user 0m0.015s
sys 0m0.000s
php-5.2 using -d extension=php_curl.dll
real 0m0.172s
user 0m0.000s
sys 0m0.015s
php-5.2 using -d extension=php_http.dll
real 0m0.078s
user 0m0.000s
sys 0m0.015s
--
Edit bug report at http://bugs.php.net/bug.php?id=52522&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52522&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52522&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=52522&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52522&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=52522&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52522&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=52522&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=52522&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=52522&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=52522&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=52522&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=52522&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=52522&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52522&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52522&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52522&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=52522&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=52522&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=52522&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=52522&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=52522&r=mysqlcfg