The functions that gather hook data from info hooks could use some db caching. We can then tackle #1524816: Implement D7 hook_hook_info() and a bunch of code gets moved out of main files and only executed on cache clears.

- flag_fetch_definition():
-- hook_flag_definitions
-- hook_flag_definitions_alter

- flag_get_link_types():
-- hook_flag_link_types
-- hook_flag_link_types_alter

and less sure about flag_get_default_flags() for hook_flag_default_flags. Should have a look at what Views does for this.

Comments

joachim’s picture

joachim’s picture

joachim’s picture

Did some benchmarking.

With session API enabled, with two flags on nodes, viewing the front page as an anonymous user that shows 4 flaggable nodes: not much difference.

Hence I'm not sure if this is worth it.

Maybe in conjunction with #1524816: Implement D7 hook_hook_info() it'll make a difference?

joachim’s picture

Status: Active » Fixed

Committed the combined patch at #1735556: [meta] flag performance: db caching, hook_hook_info() and .inc files; this issue gets one commit.

Status: Fixed » Closed (fixed)

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