Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42260 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89556 invoked from network); 14 Dec 2008 21:31:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Dec 2008 21:31:42 -0000 Authentication-Results: pb1.pair.com header.from=david@grudl.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=david@grudl.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain grudl.com from 209.85.128.186 cause and error) X-PHP-List-Original-Sender: david@grudl.com X-Host-Fingerprint: 209.85.128.186 fk-out-0910.google.com Received: from [209.85.128.186] ([209.85.128.186:39564] helo=fk-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 12/22-09557-C3B75494 for ; Sun, 14 Dec 2008 16:31:41 -0500 Received: by fk-out-0910.google.com with SMTP id 18so1397124fks.7 for ; Sun, 14 Dec 2008 13:31:37 -0800 (PST) Received: by 10.103.214.8 with SMTP id r8mr2714411muq.6.1229290297561; Sun, 14 Dec 2008 13:31:37 -0800 (PST) Received: from ?192.168.1.53? ([77.240.188.66]) by mx.google.com with ESMTPS id n10sm8061669mue.54.2008.12.14.13.31.35 (version=SSLv3 cipher=RC4-MD5); Sun, 14 Dec 2008 13:31:36 -0800 (PST) Message-ID: <49457B01.8050703@grudl.com> Date: Sun, 14 Dec 2008 22:30:41 +0100 User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: Ilia Alshanetsky CC: PHP internals References: <49453D0F.6030405@grudl.com> <0E813FC7-E17D-4BB7-B719-24A5DCB8B9B6@prohost.org> In-Reply-To: <0E813FC7-E17D-4BB7-B719-24A5DCB8B9B6@prohost.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Ternary operator optimization tip From: david@grudl.com (David Grudl) -------- Původní zpráva -------- Od: Ilia Alshanetsky > While it is slower due to the use of temp vars, in my experience > unless you have a few hundred operations involving ternary operator > you cannot even see the difference. Even then there are typically way > more important areas of code that need to be optimized. The only time > you can really tell its slower is in synthetic benchmarks. Few hundred operations involving ternary operator is nothing unusual ;) -------- Původní zpráva -------- Od: Alexey Zakhlestin > On Sun, Dec 14, 2008 at 8:06 PM, David Grudl wrote: > > Do you have any numbers? > $arr = range(0, 1000000); // very very huge array $foo = true ? $arr : NULL; // 140,00 milisec if (true) $foo = $arr; else $foo = NULL; // 0,02 milisec DG.