At the moment we statically cache the result of listing config by prefix in CachedStorage::listAll(). We store this by prefix looked for. This patch takes a different approach to save database queries - it statically caches the entire list of config and then filters. In the standard profile this saves a query on every page due to blocks and tours.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 2472561.1.patch | 4.93 KB | alexpott |
Comments
Comment #1
alexpottComment #3
alexpottWerd. Does not fail locally.
Comment #5
alexpottSo this looks like a significant saving. This benchmark is with render cache disabled.
Comment #6
alexpottLooks like something heavy was running in the background - the results from #5 can not be trusted.
We save a query but the savings don't look like much.
Comment #7
berdirThis makes sense.
* But doesn't that report actually say that it is 1.6% slower? Doing some specific micro-benchmarking might be more useful here, compare doing 2-3 separate queries vs. one + filtering in PHP. The thing is that mysql has an index on that table and is probably actually faster in filtering, but there's network overhead of course.
* I'm wondering is how much overhead it is to get all config names. I currently have 1500 config objects...
* We should update the unit test to return a number of config names that don't match, to test the filtering...
* We got rid of actually caching this list due to the expensive cache tag invalidation that happpened lots of times, especially during repeated cache writes like installation and config sync. However, if we only have a single cache key, and can maintain it during a single process, it might be almost worth considering to introduce that again. Definitely in a separate issue, and we need to profile how much difference it actually makes (apc_fetch() + unserialize of 1500 array values or a database query to fetch them). And we need to protect against concurrent writes.
Comment #8
wim leersI also asked Alex this very question, but can't remember his answer.
Comment #9
fabianx commentedI also get very kinda the same, but more function calls numbers:
So I agree with #7 that we need some micro benchmarks here.
Comment #10
alexpottComment #11
berdirSetting to needs work then for some of my feedback.
Comment #22
wim leersIs this still relevant?