Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69094 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41685 invoked from network); 12 Sep 2013 12:56:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Sep 2013 12:56:51 -0000 Authentication-Results: pb1.pair.com header.from=bobwei9@hotmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=bobwei9@hotmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain hotmail.com designates 65.55.111.100 as permitted sender) X-PHP-List-Original-Sender: bobwei9@hotmail.com X-Host-Fingerprint: 65.55.111.100 blu0-omc2-s25.blu0.hotmail.com Windows 2000 SP4, XP SP1 Received: from [65.55.111.100] ([65.55.111.100:28644] helo=blu0-omc2-s25.blu0.hotmail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 64/4B-12981-21AB1325 for ; Thu, 12 Sep 2013 08:56:51 -0400 Received: from BLU0-SMTP185 ([65.55.111.71]) by blu0-omc2-s25.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 12 Sep 2013 05:56:48 -0700 X-TMN: [hciB3e1JmtMWyyAZF+tR73aLBQuGvzaJ] X-Originating-Email: [bobwei9@hotmail.com] Message-ID: Received: from [192.168.178.42] ([188.115.28.77]) by BLU0-SMTP185.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 12 Sep 2013 05:56:45 -0700 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) In-Reply-To: Date: Thu, 12 Sep 2013 14:56:42 +0200 CC: Developers PHP Mailing List Content-Transfer-Encoding: quoted-printable References: To: Michael Wallner X-Mailer: Apple Mail (2.1508) X-OriginalArrivalTime: 12 Sep 2013 12:56:45.0103 (UTC) FILETIME=[88E6DBF0:01CEAFB7] Subject: Re: [PHP-DEV] Support for keywords where possible From: bobwei9@hotmail.com (Bob Weinand) Am 12.9.2013 um 09:10 schrieb Michael Wallner : > On 11 September 2013 23:21, Bob Weinand wrote: >> Hi! >>=20 >> I tried to widen the naming possibilities by allowing to use keywords = as identifiers (for function names, class names, label (goto) names, = ...) where possible. It doesn't break any BC. >>=20 >> Furthermore when BC needs to be broken in future for new keywords, it = will have a smaller impact as most usages of the new keyword then still = work. >=20 > I like the idea, but it looks like the patch defers many string > comparisons from the parser to strcmps. Do you have performance > comparisons of running e.g. a framework, which uses those keywords a > lot? >=20 > --=20 > Regards, > Mike A little benchmark here: https://gist.github.com/bwoebi/6536824 Here I picked always the best from 10 times running. With patch: root# ./sapi/cli/php microbench.php=20 Took for 10000 iterations: 8.6687519550323 seconds Without patch: root# ./sapi/cli/php ../bwo-php-src/microbench.php=20 Took for 10000 iterations: 8.5741410255432 seconds But this is the very worst case. (e.g. there are JUST cases where = strncasecmp needs to be used) When picking random files the results are pretty similar: With patch: root# ./sapi/cli/php microbench.php=20 Took for 10000 iterations: 15.564201116562 seconds Without patch: root# ./sapi/cli/php microbench.php=20 Took for 10000 iterations: 15.562065023422 seconds It's here only a difference of about 2 milliseconds or 0,01% what is in = the margin of error I think. Bob Weinand=