Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52508 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99016 invoked from network); 23 May 2011 19:29:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 May 2011 19:29:16 -0000 Authentication-Results: pb1.pair.com header.from=hannes.magnusson@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=hannes.magnusson@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: hannes.magnusson@gmail.com X-Host-Fingerprint: 74.125.82.170 mail-wy0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:40627] helo=mail-wy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FF/6B-34196-B85BADD4 for ; Mon, 23 May 2011 15:29:16 -0400 Received: by wyb34 with SMTP id 34so4985837wyb.29 for ; Mon, 23 May 2011 12:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=TqjZEzTmzCDWQxzoxLCejejhCGVr90hDE0tKiU+q850=; b=XJZG3yO8fUxlaVnmT2fvp05irbIe4eNa6c9nwLaIyJAckEAk9KE61Pbnk3ac7k37xO I+WgVYWrsnhfJlSbOe51KaKw5s1r9t4gcvNoauBPv89So3PKv42idloG+iWeaqPvuR6W FFDnFkE+uWc7fsJE4lwz2uJXeBwjQTxW1n7Uw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=d6xUri818Qf5gIhW4VneMdvj0OX7M9TWMnD71Q4lTyVxbHc8uoZ5bDYhwlKSlCjsYD Jbi2hYA5wSKZK7398BCVO8+H/740s/5EUG3nuzuj+6lGRuEri+74A6yV+RAWOnJJAW58 xLbVq5bFzDgKwJhfaf7nhsWzefUyPeGROs1Z0= MIME-Version: 1.0 Received: by 10.216.237.217 with SMTP id y67mr362402weq.1.1306178952339; Mon, 23 May 2011 12:29:12 -0700 (PDT) Received: by 10.216.87.206 with HTTP; Mon, 23 May 2011 12:29:12 -0700 (PDT) In-Reply-To: <4DDAA7BC.20108@sugarcrm.com> References: <4DDAA7BC.20108@sugarcrm.com> Date: Mon, 23 May 2011 21:29:12 +0200 Message-ID: To: Stas Malyshev Cc: Drak , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] call_user_func performance and dynamic code From: hannes.magnusson@gmail.com (Hannes Magnusson) On Mon, May 23, 2011 at 20:30, Stas Malyshev wrote: > Hi! > >> I'd like to ask a question about call_user_func/_array performance and >> the use of runtime variables to call functions and methods from the >> PHP internals perspective. > > There are two separate issues here: real-life PHP application performance > and internal engine performance. If you are interested in the former, please > do not read the rest of the message, instead please read this: > > My experience (10+ years of working with PHP) shows that pretty much no > application ever depends on its performance for such things. Most > applications aren't even CPU-bound and those who are, their performance very > rarely depends on how long it takes to make a function call, except for very > small number of special cases. So unless your profiling of your specific > application (not an artificial benchmark!) clearly shows this to be a > problem - it does not matter. Although you are correct when saying *most* apps, this shouldn't matter. However. It matters a lot to f.e. applications reading large XML files using XMLReader. Take PhD as an example, I think we saved over a minute few years ago when we profiled this. Just pointing out that there are perfectly valid usecase to do give this a thought :) -Hannes