Download & Extend

Add entity caching for users

Project:Drupal core
Version:8.x-dev
Component:user.module
Category:task
Priority:normal
Assigned:Unassigned
Status:active
Issue tags:Performance

Issue Summary

Opening this as a spin-off issue from #597236: Add entity caching to core. We shouldn't tackle it in the main issue since users have their own very specific problems.

Since RDF currently does a full user_load() for every comment or node viewed, and there is also #490108: user_load() should add session properties when loading the currently logged-in user suggesting loading global $user fully on every request, in the region of an 8% performance penalty (possibly more when loading more than one user per page between global $user a node and a comment), we should look at caching users in core.

Problems with this:

$user->access - however this is updated something like every three minutes now, we could consider a cache clear when it's updated, might still be worth it, or loading just the ->access property from the database while having everything else cached.

Last I looked, some things which can change user properties bypassed $user->save, but that might not be accurate.

Comments

#1

Version:7.x-dev» 8.x-dev

Not sure if the RDF issue is still valid. http://drupal.org/project/entitycache handles users now though.

nobody click here