Closed (fixed)
Project:
Breakpoints
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Dec 2015 at 02:43 UTC
Updated:
19 Oct 2016 at 06:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
KeyboardCowboyThis patch stores the breakpoints into memory on the first request and uses that data to serve subsequent load requests instead of querying the database.
Comment #3
KeyboardCowboyComment #4
KeyboardCowboyThis patch takes things a step further and utilizes Drupal's caching system to store the breakpoint and group data. This will allow sites running memcache to store the breakpoints data into memcache, thus completely eliminating the breakpoint database requests until the cache is cleared.
Comment #6
attiks commentedCommitted and pushed to dev version, can somebody test it so I can make a release
Comment #7
dave reidThe places that are now calling cache_clear_all() are not calling drupal_static_reset() so this function will contain stale data until the next request.
Overall I feel like this is odd knowing that CTools itself also uses database caching, and rather than storing in yet-another-database-cache, just adding static caching, and loading them all at once from CTools would be the primary improvement.
Comment #8
dave reidYes, we just have to enable 'cache defaults' as per the CTools export documentation.
Comment #9
dave reidHrm, so the caching is for the default exported objects, so it skips invoking the hooks, but still requires one database read on loading either all breakpoints or all groups for reading from the table itself.
Comment #10
dave reidThis gets me down to loading from the cache table only for both breakpoints and breakpoint groups. Abstract cache clearing to separate functions for re-use, and takes advantage of the 'load all callback' to help centralize caching.
Comment #11
dave reidComment #12
dave reidMissed that $bin parameter to cache_clear_all() is required if using a specific $cid parameter.
Comment #13
attiks commentedCommitted to dev
Comment #15
jelle_s