Noticed that we have cache writes of the AliasWhitelist cache collector implementation on every request.

The problem is that the implementation wasn't updated for the lazy-loading behavior that was added. It initializes the storage if empty, but because the storage is loaded on demand and the check is in the constructor, it does it on every single request again.

Comments

berdir’s picture

Status: Active » Needs review
StatusFileSize
new718 bytes

Wondering how many times we already introduced stupid bugs like this (and how many of those were mine..) by trying to making something faster...

dawehner’s picture

I guess there is no way to generically ensure something like that, but at least test coverage for every example would work.

berdir’s picture

MemoryCounterBackend++, poor-man-mocking :)

Status: Needs review » Needs work

The last submitted patch, alias-whitelist-cache-writes-2071655-3-tests-only.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review

Fail/Pass as expected, so back to needs review.

catch’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

If we had automated performance tests, we could record the number of database inserts per page and something like this would be pretty obvious. We don't have that, but this is a nice retrospective test.

catch’s picture

Status: Reviewed & tested by the community » Fixed

No-one complained about the RTBC, so I've gone ahead and committed/pushed this to 8.x.

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