Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81960 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58882 invoked from network); 5 Feb 2015 20:09:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2015 20:09:47 -0000 Authentication-Results: pb1.pair.com header.from=mike.php.net@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=mike.php.net@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.52 as permitted sender) X-PHP-List-Original-Sender: mike.php.net@gmail.com X-Host-Fingerprint: 74.125.82.52 mail-wg0-f52.google.com Received: from [74.125.82.52] ([74.125.82.52:55130] helo=mail-wg0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 21/F9-27691-90EC3D45 for ; Thu, 05 Feb 2015 15:09:45 -0500 Received: by mail-wg0-f52.google.com with SMTP id y19so9562897wgg.11 for ; Thu, 05 Feb 2015 12:09:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=Z0JEhbshzTPdsRmDSU/GMCS+JRs8Eqf6/+TyNBiKlv4=; b=WuEJMwrK1Or19HKwGqeFu42DfAHPh5QRDWFEBuJXWmU2vcyH4zpJykw9lnjgO0mVXD VJYE1LnPuO+1jT4K/soW1IznVmuXPrWCp/ltbQJPVKGfhB7Ow0ptk6Yh8O37BIbQYKwQ ZwWpCHubCawQsh7u2YatyHXfrjXFhYgIQjBp8kUXCswJsLJaeFNo4hwXRhfuVZhVq7M0 j2+7hHKWqc0x9H9a8wwhZ0pcmiRYPoyc48TtLu6+AkCBFM35daWmOeUjyId4kf7Jpa+X WeQfAbKmGdBIHLXFLaaH5a7Nq/luhXgcCZ4dimKuYHLDAVsm1iUvaWWvcxa7FyShjHbf ohsA== X-Received: by 10.180.77.39 with SMTP id p7mr475425wiw.8.1423166980839; Thu, 05 Feb 2015 12:09:40 -0800 (PST) Received: from [192.168.2.120] (89-104-28-113.customer.bnet.at. [89.104.28.113]) by mx.google.com with ESMTPSA id fo17sm259749wjc.19.2015.02.05.12.09.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Feb 2015 12:09:39 -0800 (PST) Sender: Michael Wallner Message-ID: <54D3CE01.4070903@php.net> Date: Thu, 05 Feb 2015 21:09:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Pierre Joye CC: PHP internals , Stas Malyshev References: <54D217E7.8030407@php.net> <54D2AE91.8090800@gmail.com> <54D3271E.2080207@php.net> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Re: [RFC] [DISCUSSION] pecl_http From: mike@php.net (Michael Wallner) Hi Pierre! On 05/02/15 18:49, Pierre Joye wrote: > > On Feb 5, 2015 3:17 PM, "Michael Wallner" > wrote: >> >> Compare the timings accessing google 20 times sequentually: >> >> With default of raphf.persistent_handle.limit=-1 (unlimited): >> █ mike@smugmug:~$ time php -r 'for ($i=0;$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: >> █ mike@smugmug:~$ time php -d raphf.persistent_handle.limit=0 -r 'for >> ($i=0;$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? > Does the following kcachegrind screenshot give an idea (I used a minimum node cost of 10% to simplify the graph)? Left is raphf enabled (24M Ir) and on the right raphf disabled (35M Ir): http://dev.iworks.at/ext-http/raphf.png Have a look on the top-most far-right highlighted block, which is solely devoted to tearing up curl instances when raphf is disabled. -- Regards, Mike