On Mon, May 20, 2019 at 1:00 PM Gabriel O <gade...@gmail.com> wrote:

> > Every time function autoloading been brought up in the past, there
> > have been concerns about performance issues when calling a global
> > function from inside a namespace. E.g. calling `strlen` in a loop
> > would become far slower if every call has to trigger the autoloader.
> 
> This trick for perf improvement is overblown. It's misconception that it
> does provide speed advantage for most functions and reasons behind it. It
> does so only for those implemented as opcodes. People started to abuse it
> by importing ALL functions. Such overzealous approach completely prevents
> useful things like function mocking.

Can you clarify? I'm not sure what performance improvement trick you
are referring to, or what you mean by "importing all functions". Are
you saying it's a misconception that triggering an autoloader on
unqualified function calls in a namespace will slow down performance?
As I understand it, this is the roadblock for function autoloading.

Best regards,
Theodore
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to