In the implementing modules, a lot of field information is retrieved in hook_facetapi_facet_info() implementations. We should test the performance impact of caching it's return value to improve performance. Of course, cache invalidation will be an issue since Facet API has no concept of what data is being stored as facets.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | facet-info-caching-1394200-1.patch | 6.56 KB | cpliakas |
| #1 | facet-info-caching-no-whitespace-1394200-1.txt | 1.57 KB | cpliakas |
Comments
Comment #1
cpliakas commentedAfter testing on my laptop with the default SQL based cache, the time taken to gather facet info decreased from 0.015 seconds to 0.001 seconds. Therefore this is definitely worth looking at more closely. The attached patch makes the change, but it is mostly whitespace differences so I attached a no-whitespace patch as well to better highlight the change in functionality. The cache is invalidated when fields change, so there is a field API assumption. However, all implementing modules currently only index field data, so this should be OK to make this change backwards compatible. The only concern I have is with Search API where the fields may be calculated a bit differently, and you can select which fields are indexed through the GUI.
Comment #2
cpliakas commentedCommitted at http://drupalcode.org/project/facetapi.git/commit/0b112c5.
We'll resolve any issues in RC2.
Comment #3
cpliakas commentedAdding "Performance" tag.
Comment #4.0
(not verified) commentedUpdated issue summary.