Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81951 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41279 invoked from network); 5 Feb 2015 17:49:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2015 17:49:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.46 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.216.46 mail-qa0-f46.google.com Received: from [209.85.216.46] ([209.85.216.46:42800] helo=mail-qa0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 07/96-27691-71DA3D45 for ; Thu, 05 Feb 2015 12:49:11 -0500 Received: by mail-qa0-f46.google.com with SMTP id j7so6913731qaq.5 for ; Thu, 05 Feb 2015 09:49:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=SeS9eRnOZqpo74hhm1Se+cQBLgZrbaMTFQeGfjWPKqU=; b=qotOtjdSTRCYx0co0TBhsp/LylnwN0wVCHnKC21SAGRqxxsBzfEn95T+Iitml2vJGS lAp8bHRrmasqpg+/ZqOI5s8a23SCyPEPT/Yekb2fKpgK2ZjF3CR7KmPo9BqLTUbCX8b2 k458FYuK2ldd8/HnlWb6+J+0ZB/tozorHB6FxpniYWYNA6LoleTadxf2jMgczuoB3zZS B0DSSr4jdCaxnXo0HOa7tli8dzbJMFF+nNirz4i37w5D70B/jTkaa59j586W2HJZKcey OoNoG/JYEwkQYR2zpq2mUumCsuHsmZbkL5byRdOWsc2i2qb8G4w8w9JusD6Rz2lD58gQ rwFg== MIME-Version: 1.0 X-Received: by 10.224.89.65 with SMTP id d1mr715452qam.40.1423158547452; Thu, 05 Feb 2015 09:49:07 -0800 (PST) Received: by 10.96.3.168 with HTTP; Thu, 5 Feb 2015 09:49:06 -0800 (PST) Received: by 10.96.3.168 with HTTP; Thu, 5 Feb 2015 09:49:06 -0800 (PST) In-Reply-To: <54D3271E.2080207@php.net> References: <54D217E7.8030407@php.net> <54D2AE91.8090800@gmail.com> <54D3271E.2080207@php.net> Date: Fri, 6 Feb 2015 00:49:06 +0700 Message-ID: To: Michael Wallner Cc: PHP internals , Stas Malyshev Content-Type: multipart/alternative; boundary=001a11c3bb8eae1872050e5aeb57 Subject: Re: [PHP-DEV] Re: [RFC] [DISCUSSION] pecl_http From: pierre.php@gmail.com (Pierre Joye) --001a11c3bb8eae1872050e5aeb57 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Feb 5, 2015 3:17 PM, "Michael Wallner" wrote: > > Hi Stas! > > On 05/02/15 00:43, Stanislav Malyshev wrote: > > Hi! > > > >> Points explicitely marked for discussion in the RFC itself: > >> > >> * pecl/propro > >> Proxies for properties representing state in internal C structs > >> https://wiki.php.net/rfc/pecl_http#peclpropro > >> > >> * pecl/raphf > >> (Persistent) handle management within objects instead of resources > >> https://wiki.php.net/rfc/pecl_http#peclraphf > >> Also, take special note of the INI setting: > >> https://wiki.php.net/rfc/pecl_http#raphf_ini_setting > > > > I'm still not sure why we need these two, to be frank. E.g., for the > > former I can kind of get it, though I don't see any use-case that reall= y > > requires going to such lengths, for the latter I'm not even sure what > > the case for that is - i.e., why exactly would one need persistent HTTP > > connections surviving the request? > > Uh, for me it's actually the reverse :) While propro is nice to have, I > think raphf is far more of practical use. Why should HTTP, or even more > HTTPS or HTTP2, be any different than another service, especially when > HTTP APIs are so common nowadays. > > Compare the timings accessing google 20 times sequentually: > > With default of raphf.persistent_handle.limit=3D-1 (unlimited): > =E2=96=88 mike@smugmug:~$ time php -r 'for ($i=3D0;$i<20;++$i) {(new > http\Client("curl","google"))->enqueue(new http\Client\Request("GET", > "http://www.google.at/"))->send();}' > > 0.03s user 0.01s system 2% cpu 1.530 total > > > With raphf effectively disabled: > =E2=96=88 mike@smugmug:~$ time php -d raphf.persistent_handle.limit=3D0 -= r 'for > ($i=3D0;$i<20;++$i) {(new http\Client("curl","google"))->enqueue(new > http\Client\Request("GET", "http://www.google.at/"))->send();}' > > 0.04s user 0.01s system 1% cpu 2.790 total While I like the idea, I would not take it as it. Many things could affect it and I am not sure the persistent resource is what spare times. Any profiling info with delta? --001a11c3bb8eae1872050e5aeb57--