Problem/Motivation

While profiling #2498919: Node::isPublished() and Node::getOwnerId() are expensive, I noticed that PermissionsHashGenerator is called multiple times (5, in my case) and every time calls out to the cache backend. That's almost 1ms in my case.

Caching itself might be questionable. For my authenticated user with only the default permissions from the authenticated role, fetching from cache was actually slower than generating the hash. But I guess that is different if you have multiple roles and many permissions.

Proposed resolution

Add a static cache, by uid or list of roles.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

wim leers’s picture

Status: Active » Closed (duplicate)
Related issues: +#2501117: Add static caching for PermissionsHashGenerator::generate()

catch is already doing this in #2501117: Add static caching for PermissionsHashGenerator::generate() :) For the exact same reason.