Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79919 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56158 invoked from network); 24 Dec 2014 11:16:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Dec 2014 11:16:58 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:40881] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B0/D0-50910-8A0AA945 for ; Wed, 24 Dec 2014 06:16:57 -0500 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 0CC57EA085; Wed, 24 Dec 2014 11:16:54 +0000 (GMT) Date: Wed, 24 Dec 2014 11:16:53 +0000 (GMT) X-X-Sender: derick@whisky.home.derickrethans.nl To: Stanislav Malyshev cc: Jacob Bednarz , internals@lists.php.net In-Reply-To: <5499E5A4.2080106@gmail.com> Message-ID: References: <5499E5A4.2080106@gmail.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] Line profiler for PHP From: derick@php.net (Derick Rethans) On Tue, 23 Dec 2014, Stanislav Malyshev wrote: > > The questions I have are: - Is this even possible? > > Yes, should be possible but: > 1. If you want precision, it would slow down your code a lot, as > basically you need to record timing of each opcode, which can be very > expensive. > 2. If you're ok with less precision, you can do sampling, but in that > case you probably need your script to spend a lot of time in the same > areas of the code to have any meaningful results, otherwise it'd be just > random. > > > - Are there any projects out there or being worked on that achieve > > this? > > Most of the profilers afaik go by functions. Most probably because > line-level profiling would be so intrusive as to not produce really > valid results, but maybe it can be done in a way that is not that > intrusive. I have played with it for Xdebug, but it was too much of a slow down to be of any use... cheers, Derick -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug Posted with an email client that doesn't mangle email: alpine