Re: Re: Typed properties patch
| From: | Dmitry Stogov | Date: | Tue, 19 Apr 2016 20:29:16 +0000 |
| Subject: | Re: Re: Typed properties patch | ||
| 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-92492@lists.php.net to get a copy of this message | ||
On 04/19/2016 10:53 PM, Stanislav Malyshev wrote:
Hi!This is good for programmers who think like me, for compiler and for hardware CPU :) You have another opinion, and we won't persuade each other. Lets stop this discussion, because everyone who read already understood both point of views.More properly - PHP is done in a way that doesn't allow big data processing yet :) LuaJIT may be used for in-kernel packet filtering...But we're not targeting PHP for in-kernel packet filtering. And we should not sacrifice language semantics for minuscule gains in performance. Especially given that banning unset by itself will achieve nothing - you also have to deal with lots of other ways object can be initialized. OK. In my opinion, if something is defined as "int" should be always "int". Nor "null" neither "undefined".
Run bench.php with CALL and GOTO VM. You'll see 20-30% performance difference caused by branch miss-prediction.That's whole VM, not one branch which is never taken. Yes, this is just an example how branch miss-prediction may affect performance.
but if we can't provide type safety for all cases, we shouldn't try to do this for some case, shouldn't name this "typing" and shouldn't perform type checks at all. Lets name this "type annotations" and don't perform run-time type checks (like HHVM Hack do). Thanks. Dmitry.I think, If we may eliminate checks we should do it (at type-system design level).I don't think we really can without introducing some very strange limitations, like banning unsets or limiting serialization or introducing special magic methods that are optimized differently, etc. Personally, I think we can,