On 04/18/2016 09:37 PM, Stanislav Malyshev wrote:
Hi!
right.
I don't see any reasons for types, if they are not guaranteed anyway.
Well, we already have parameter types, and they are not guaranteed
either - you can reassign variables.
They guarantee the type of argument on function entry.
This depends on use case.
Just imagine matrix multiplication (or something similar).
Few additional instructions would decrease the speed significantly.
I think this is a very narrow use case. If somebody does large data
processing (like large matrix multiplication) in pure PHP, they are
doing it wrong anyway.
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...
So trying to optimize for their use case I think
is not a high priority. I would say for any typical PHP app cost of one
unexpected branch is negligible.
One is not, but 100 matters.
Run bench.php with CALL and GOTO VM.
You'll see 20-30% performance difference caused by branch miss-prediction.
Now think about JIT, and "code-bloat" caused by additional type checks.
I think, If we may eliminate checks we should do it (at type-system
design level).
Thanks. Dmitry.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php