Cool stuff..
didn't try yet, but I was thinking the same and then found this :)

I think this could give us a nice speed boost..
I don't know how exactly PHP extensions look from the inside, and what information you have available, so.. just tell me if it is possible :)

1. Each time a new function is defined, the extension will explode it into parts ("node" + "load", etc).
2. These parts are stored in a lookup list, such as $list[$prefix][$suffix] = $function, but on C level.
3. In a similar way, we maintain a list of known module names.. (how that?)
4. module_implements($hook) only needs to look up $list[$hook], and "intersect" that with a list of known module names.

Obviously, this requires that you can react to new functions entering the namespace.

Comments

rjbrown99’s picture

There's also this: #557542: Cache module_implements() . Different approach but certainly makes it faster.