While doing some basic token performance optimizations I noted that menu_tokens() loads node menu link data regardless whether the tokens are used.

Attached patch fixes it for me, what saved ~4ms on an average page request making use of tokens and passing a node.

Comments

Status: Needs review » Needs work

The last submitted patch, token_node_menu.patch, failed testing.

fago’s picture

Status: Needs work » Needs review
StatusFileSize
new2.27 KB

Uhm, it's faster but breaks the token :D Next try.

dave reid’s picture

StatusFileSize
new2.79 KB

Revised patch that puts this logic in a cached function which is re-usable.

dave reid’s picture

Status: Needs review » Fixed

Committed #3 to Git! Thanks fago for helping speed this up!
http://drupalcode.org/project/token.git/commit/80c08b7

Status: Fixed » Closed (fixed)

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