Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79898 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92233 invoked from network); 23 Dec 2014 22:34:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Dec 2014 22:34:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=jacob.bednarz@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jacob.bednarz@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.175 as permitted sender) X-PHP-List-Original-Sender: jacob.bednarz@gmail.com X-Host-Fingerprint: 209.85.223.175 mail-ie0-f175.google.com Received: from [209.85.223.175] ([209.85.223.175:43052] helo=mail-ie0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9E/94-01814-DDDE9945 for ; Tue, 23 Dec 2014 17:34:06 -0500 Received: by mail-ie0-f175.google.com with SMTP id x19so6773183ier.20 for ; Tue, 23 Dec 2014 14:34:02 -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=XrmQBmgwxCu+LYBj9QbCwmPZyXpLh1cQwFz3FP7Eyl0=; b=EV0lmRgTJZNSx9s82UL9SsYlYQYeWLkM50lyeAJ7o0Pf25G18VRHQSf20BQtMrnTt9 C6CKPX9Gxb4ELvkleB22KaMwI8Ld1ACCfp+SnYMYlguzAeRxAmgp6oQYJ9Gd1Qn6e/wp Bjcgogs0jMW6UPqkgtRM0B16uzNOGgE43s2rxKUVh7ONGSI0fliaYwKRhRSCSfHLpO21 JGvFWcXBrtDuW+F3AGOh4fwCzVhlT79Kh6jVxfYWwQQwYEJQ/UnjV+0w154jDiQuSjo9 eZW0YX8OwAdCWR5fDEojhXpZ4wRXXex/fPmihmctcyCC0YEXNbt1jpLCDORMu9uq3/z/ f09w== MIME-Version: 1.0 X-Received: by 10.50.134.133 with SMTP id pk5mr12471512igb.3.1419374042482; Tue, 23 Dec 2014 14:34:02 -0800 (PST) Received: by 10.107.132.212 with HTTP; Tue, 23 Dec 2014 14:34:02 -0800 (PST) In-Reply-To: References: Date: Wed, 24 Dec 2014 08:34:02 +1000 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary=047d7b2e0b599b106b050ae9c588 Subject: Re: [PHP-DEV] Line profiler for PHP From: jacob.bednarz@gmail.com (Jacob Bednarz) --047d7b2e0b599b106b050ae9c588 Content-Type: text/plain; charset=UTF-8 > > 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. I'm not too concerned about the cost as this would only be running locally and the for the purpose of profiling. The proviso with this would be that the costs associated didn't reflect in the line profile time and skew the results. Stackoverflow question http://stackoverflow.com/q/1113034/214196 has > the link to some profiling tool that seems to do line-level, but from the > fact > they mention PHP 4 support I'm not sure how up-to-date it is. I will be sure to check it out - thanks. > Not sure what you mean by "parsing the file correctly" - PHP engine does > the parsing, profiler shouldn't do any parsing. By this I mean I have looked at implementing it a couple of different ways and each time I get caught up on timing code that spans multiple lines such as: $array = array( 'my_key' => 'my_value', ); Where I want to measure the variable assignment however because it spans multiple lines I can't work out the best way to include it all. 'Parsing' is probably the incorrect term here but it's all that came to mind when writing this :p I've implemented a basic sampling profiler with line-level resolution some > time ago: https://github.com/nikic/sample_prof Thanks a bunch! I will check it out and see if I can get it working for what I am after. --047d7b2e0b599b106b050ae9c588--