php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52522 php_curl.dll, php_http.dll take 300ms to initialize
Submitted: 2010-08-03 13:03 UTC Modified: 2010-08-08 16:26 UTC
From: roman dot neuhauser at ge dot com Assigned: pajoye (profile)
Status: Duplicate Package: cURL related
PHP Version: 5.3.3 OS: Windows
Private report: No CVE-ID: None
 [2010-08-03 13:03 UTC] roman dot neuhauser at ge dot com
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-04 10:05 UTC] pajoye@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: pajoye
 [2010-08-08 16:26 UTC] pajoye@php.net
Duplicate of #50410
 [2010-08-08 16:26 UTC] pajoye@php.net
-Status: Assigned +Status: Duplicate
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Sep 23 13:01:25 2018 UTC