Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99445 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93202 invoked from network); 7 Jun 2017 21:27:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Jun 2017 21:27:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=ben.coutu@zeyos.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ben.coutu@zeyos.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zeyos.com designates 88.99.153.70 as permitted sender) X-PHP-List-Original-Sender: ben.coutu@zeyos.com X-Host-Fingerprint: 88.99.153.70 mx.zeyos.com Received: from [88.99.153.70] ([88.99.153.70:41182] helo=mx.zeyos.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0C/5A-27119-9AF68395 for ; Wed, 07 Jun 2017 17:27:06 -0400 Received: from mx.zeyos.com (localhost [127.0.0.1]) by mx.zeyos.com (Postfix) with ESMTP id 945A574D23 for ; Wed, 7 Jun 2017 23:27:01 +0200 (CEST) Authentication-Results: mx.zeyos.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=zeyos.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zeyos.com; h= content-transfer-encoding:content-type:content-type:mime-version :to:subject:subject:from:from:date:date; s=dkim; t=1496870821; x=1497734822; bh=OfWcifPAbfqkBUfa+Str9cpOS+lyQT9lWlWTJis+BIs=; b= SSjcS2dmpJQmUD6VLWO8gTFKfKWkYpbq9rMdNZSYJeo1yynPUiu6hH28HgCem7+p FtGHHd1jAuP/dkrIEh/bbx+C4c+CkJHmoD4K2Wl6zwHUBNQakEBgQS8U5DcKtaWW juHBT4kQ7iBowJnEqh1G4Mp+VQ5MN9fSNWrS5iV0rm0= X-Virus-Scanned: Debian amavisd-new at mx.zeyos.com Received: from mx.zeyos.com ([127.0.0.1]) by mx.zeyos.com (mx.zeyos.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Z4isUsb9z0XG for ; Wed, 7 Jun 2017 23:27:01 +0200 (CEST) Received: from [81.171.8.203] (unknown [81.171.8.203]) by mx.zeyos.com (Postfix) with ESMTPSA id 5544974D17; Wed, 7 Jun 2017 23:27:01 +0200 (CEST) Date: Wed, 07 Jun 2017 23:27:01 +0200 To: Fleshgrinder , php-internals , Dmitry Stogov MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20170607212701.945A574D23@mx.zeyos.com> Subject: Re: [PHP-DEV] Basic string comparison functions still use old parameter parsing API From: ben.coutu@zeyos.com (Benjamin Coutu) Thanks for creating a pull request for this!=0A=0A=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Original =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0AFrom: Fleshgrinder =0ATo: php-internals , ben.coutu@ze= yos.com, Dmitry Stogov =0ADate: Wed, 07 Jun 2017 21:29:56 = +0200=0ASubject: Re: [PHP-DEV] Basic string comparison functions still use = old parameter parsing API=0A=0A> On 6/7/2017 7:15 PM, Benjamin Coutu wrote: > > Hi Dmitry, > >=20 > > I just noticed that all basic string comparison functions in > > Zend/zend_builtin_functions.c, especially "strcmp", "strncmp", > > "strcasecmp", "strncasecmp" still use the old and inefficient > > parameter parsing API, unlike similar functions in > > ext/standard/string.c such as "substr_compare", "strtok", > > "str(i)str", "str(i)pos", "strr(i)pos", "strrchr" that already > > consistently use the new efficient macro-based API. > >=20 > > I think one can consider "str(n)cmp" and "str(n)casecmp", etc. at > > least as important as "substr_compare", especially considering that > > these are wrappers around very basic functions that often get called > > in very hot code or inside tight loops (e.g. sorting). I therefore > > recommend changing those 4 functions in Zend/zend_builtin_functions.c > > to use ZEND_PARSE_PARAMETERS_* macros for PHP 7.2. > >=20 > > What do you think? > >=20 >=20 > Help? :) >=20 > https://github.com/php/php-src/pull/2565 >