So, finally a first beta of pecl_http 1.6 has been released.
This is the first version which supports libcurls multi socket API introduced in 7.16 through libevent.
Here's a not very impressive comparison of the performance of the traditional multi API vs. the new multi socket API:
mike@honeybadger:~/build/php-5.2-debug$ cli \
~/cvs/pecl/http/scripts/bench_select_vs_event.php \
-u http://honeybadger/empty.html
> 1.134667s
mike@honeybadger:~/build/php-5.2-debug$ cli \
~/cvs/pecl/http/scripts/bench_select_vs_event.php \
-u http://honeybadger/empty.html
> 1.151088s
mike@honeybadger:~/build/php-5.2-debug$ cli \
~/cvs/pecl/http/scripts/bench_select_vs_event.php \
-u http://honeybadger/empty.html
> 1.131867s
mike@honeybadger:~/build/php-5.2-debug$ cli \
~/cvs/pecl/http/scripts/bench_select_vs_event.php \
-u http://honeybadger/empty.html -e
> 0.993878s
mike@honeybadger:~/build/php-5.2-debug$ cli \
~/cvs/pecl/http/scripts/bench_select_vs_event.php \
-u http://honeybadger/empty.html -e
> 0.998832s
mike@honeybadger:~/build/php-5.2-debug$ cli \
~/cvs/pecl/http/scripts/bench_select_vs_event.php \
-u http://honeybadger/empty.html -e
> 0.997121s
Above empty.html is, well, empty. The following test requests a 100k file:
mike@honeybadger:~/build/php-5.2-debug$ cli \
~/cvs/pecl/http/scripts/bench_select_vs_event.php \
-u http://honeybadger/100k.bin
> 2.205190s
mike@honeybadger:~/build/php-5.2-debug$ cli \
~/cvs/pecl/http/scripts/bench_select_vs_event.php \
-u http://honeybadger/100k.bin
> 2.210525s
mike@honeybadger:~/build/php-5.2-debug$ cli \
~/cvs/pecl/http/scripts/bench_select_vs_event.php \
-u http://honeybadger/100k.bin
> 2.254281s
mike@honeybadger:~/build/php-5.2-debug$ cli \
~/cvs/pecl/http/scripts/bench_select_vs_event.php \
-u http://honeybadger/100k.bin -e
> 2.007220s
mike@honeybadger:~/build/php-5.2-debug$ cli \
~/cvs/pecl/http/scripts/bench_select_vs_event.php \
-u http://honeybadger/100k.bin -e
> 1.945564s
mike@honeybadger:~/build/php-5.2-debug$ cli \
~/cvs/pecl/http/scripts/bench_select_vs_event.php \
-u http://honeybadger/100k.bin -e
> 1.969575s
So, apparently time savings are not huge, but noticable.
Just wanted to say that I've only just come across the pecl_http extension and I wanted to say that I think it's ace! I do a lot of ReST based PHP work, and I spent ages building what was essentially a PHP version of your extension, so I was super-happy to find your extension has done most of the hard work for me! So thanks!
I always though that PHP http features were a bit 'unusual': I personally HATE the $_GET, $_POST magic variables, and have found that working with HTTP in general in PHP to be a ball-ache, though it is getting better (the streams support is pretty wild, and I'm digging it).
Anyways, this was just a quick note to say keep up the good work dude!
P.S. I've been using the pecl4win pecl_http.dll at work to test with, but when I built the latest and previous versions using phpize on OSX Tiger, I got an error and Apache refused to start. I raised a bug issue on the pecl site. Let me know if you need any more information.