Closed (fixed)
Project:
Flag
Version:
7.x-3.x-dev
Component:
Flag core
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
28 Jul 2012 at 14:36 UTC
Updated:
27 Sep 2012 at 08:11 UTC
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
Comment #1
joachim commented#1113904: Use drupal_static() instead of plain ol' static has to come first.
Comment #2
joachim commentedAnd #1726808: remove $reset param from flag_get_link_types() is in the way too.
Comment #3
joachim commentedDid 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?
Comment #4
joachim commentedCommitted the combined patch at #1735556: [meta] flag performance: db caching, hook_hook_info() and .inc files; this issue gets one commit.