Re: Introducing "Array Of" RFC
| From: | Martin Keckeis | Date: | Thu, 16 Jan 2014 11:31:55 +0000 |
| Subject: | Re: Introducing "Array Of" RFC | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-71179@lists.php.net to get a copy of this message | ||
2014/1/16 Matthieu Napoli <matthieu@mnapoli.fr>
> Le 16/01/2014 11:01, php@tutteli.ch a écrit :
>
> + 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 enough
> iterations probably), it's easy to take only the worst one. Here, I'll take
> 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...