Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71179 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8144 invoked from network); 16 Jan 2014 11:31:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jan 2014 11:31:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=martin.keckeis1@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=martin.keckeis1@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.182 as permitted sender) X-PHP-List-Original-Sender: martin.keckeis1@gmail.com X-Host-Fingerprint: 209.85.214.182 mail-ob0-f182.google.com Received: from [209.85.214.182] ([209.85.214.182:41817] helo=mail-ob0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6A/43-24763-E23C7D25 for ; Thu, 16 Jan 2014 06:31:58 -0500 Received: by mail-ob0-f182.google.com with SMTP id wn1so2586592obc.41 for ; Thu, 16 Jan 2014 03:31:55 -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=mKaOZA+0NMcNtsLtux0IEh2U8H+oVczkugzp5p7WPIY=; b=lQ154p4/g7Uwb2LgI0FV89prmuBtUdX94EK6LQKS8huUKEh87OaVCMHnNDTItYAuiD 6AAaWLrKGcajOFQYlb/6MdCxl3RYuJJ5RO5lQKGZz3CGeWipFBYEwUaEL2lZbSjMTNiT 5OUN8tXNegIE7FgpYTT07L9Q35bFSbVLcA7Wjli8ErtlOKkPDioH0y0cP8wIdvFS9HT/ 9MH9QrU2JwuXFPSFtEMxZxKNJDuwALly8JJ9cFj7CD3qGc1A5PYvAIFZhjR4UvHotwEb 1+EyafrT1t/nTtStGHuux6kuv92gDO0GQRrETjqrJHXCXjdoz7hEfbPhUjrnVbJD0fjk iSxQ== MIME-Version: 1.0 X-Received: by 10.182.226.202 with SMTP id ru10mr3958271obc.7.1389871915607; Thu, 16 Jan 2014 03:31:55 -0800 (PST) Received: by 10.182.29.38 with HTTP; Thu, 16 Jan 2014 03:31:55 -0800 (PST) In-Reply-To: <0B.B1.24763.139B7D25@pb1.pair.com> References: <001301cf1227$6d082ab0$47188010$@tutteli.ch> <002d01cf1234$01e6dc60$05b49520$@tutteli.ch> <004c01cf123d$35730870$a0591950$@tutteli.ch> <52D71748.1090402@googlemail.com> <52D71FAE.8030002@ajf.me> <005001cf124f$3a40df00$aec29d00$@tutteli.ch> <20140116110127.202079vzjsj76n7b@webmail.tutteli.ch> <0B.B1.24763.139B7D25@pb1.pair.com> Date: Thu, 16 Jan 2014 12:31:55 +0100 Message-ID: To: Matthieu Napoli Cc: PHP internals Content-Type: multipart/alternative; boundary=001a11c32efad02c9404f014c5db Subject: Re: [PHP-DEV] Introducing "Array Of" RFC From: martin.keckeis1@gmail.com (Martin Keckeis) --001a11c32efad02c9404f014c5db Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2014/1/16 Matthieu Napoli > Le 16/01/2014 11:01, php@tutteli.ch a =C3=A9crit : > > + 1 for the RFC >>> >>> But if i'm not completely wrong, there is performance decrease instead = of >>> increase in your tests? >>> https://gist.github.com/krakjoe/8444591 >>> >>> [joe@fiji php-src]$ sapi/cli/php isTest.php 10000 >>> objects: 10000 >>> arrayof: 0.00645113 >>> instanceof: 0.00560713 >>> >> >> I gave the RFC a few more thoughts and came to the conclusion that it >> does not fit to PHP (due to the performance penalties involved). >> > > The performance penalty is the same as if you were type-checking yourself= . > > And on the gist linked, we can see that the results vary a lot (not enoug= h > iterations probably), it's easy to take only the worst one. Here, I'll ta= ke > the one where the numbers are inversed to "prove" my point: > > > [joe@fiji php-src]$ sapi/cli/php isTest.php 1000 > objects: 1000 > arrayof: 0.00080991 > instanceof: 0.00086308 > > Yes i saw the good result too. Just wondered why native PHP was slower sometimes... --001a11c32efad02c9404f014c5db--