Introduces a static for defined() - saves the cost of defined() itself, and the cost of the function calls. module_implements() becomes about twice as fast internally, and about 1/3 faster inclusive.

See also #523358: Optimize drupal_function_exists()

CommentFileSizeAuthor
#4 module_implements.patch1.08 KBcatch
patch.png365.77 KBcatch
head.png383.48 KBcatch
module_implements.patch977 bytescatch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

catch’s picture

Issue tags: +Registry
Crell’s picture

Status: Needs review » Reviewed & tested by the community

I'm trying to think of a case where this would need to be drupal_static() instead of static, and I can't find one. So yay to slightly faster code.

Dries’s picture

Status: Reviewed & tested by the community » Needs work

Let's add a code comment and resubmit as RTBC.

catch’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
1.08 KB

Added the comment.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks! :)

Status: Fixed » Closed (fixed)
Issue tags: -Performance, -Registry

Automatically closed -- issue fixed for 2 weeks with no activity.