Closed (won't fix)
Project:
Drupal core
Version:
8.0.x-dev
Component:
rdf.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Mar 2011 at 13:07 UTC
Updated:
29 Jul 2014 at 19:25 UTC
Jump to comment: Most recent file
Comments
Comment #1
Remon commentedComment #2
mlncn commentedThe previous patch is tested and RTBC after this re-roll for 8 is committed (special thanks to xjm's Drupal 8 core reroll instructions).
Comment #3
scor commentedlooks good, waiting for the testbot to finish.
Comment #4
scor commentedLooks good. RDFx in contrib allows to set namespaces in the database for example, so caching makes sense.
Comment #5
no_commit_credit commentedComment #6
xjmAbove fixes the comments to wrap properly before 80 chars. :)
Comment #7
webchickSeems reasonable, and don't think there's a way to test this really that wouldn't just be testing drupal_static().
Committed and pushed to 8.x and 7.x.
Comment #8
moshe weitzman commentedI see no justification here for adding a cache. Whats is slow here? Can't we cache the thing that is slow?
Comment #9
webchickMoving back to needs review for discussion.
Moshe, can you please write up some documentation for the Performance gate on when it is/is not acceptable to add static caching? I always get yelled at whenever I commit a patch like this, but I don't understand why. :)
Comment #10
webchickComment #11
scor commentedCore alone won't see any performance benefit because all the namespaces are in code, but it's when used with modules that store namespaces in the database that improvements will be seen. The main reason caching was suggested here is that namespaces are very unlikely to be changing during a given page load, so it doesn't make sense to invoke the namespaces hooks every time namespaces definitions are needed.
Like webchick said, some documentation about the cost of caching would be helpful.
Comment #12
moshe weitzman commentedOK, so we put this in in order to babysit slow Contrib processes. Thats not the job of core. If a module can't return namespaces quickly, then *it* should cache, not core.
We don't add static caches every time we see a function getting called twice (or more). It has to be called multiple times *and* be slow. If it can sometimes be slow, we should cache as close to the slowness as possible.
The cost of caching is a decay in developer and admin experience. One now has to add resets and remember to add resets when related data changes. In general, invalidating cache at right time is a huge headache, and thats why we should resist adding static (and persistent) caches except when really needed.
I'll try to blog about this topic soon.
Comment #13
scor commentedpoint taken. let's revert this patch then please.
Comment #14
moshe weitzman commentedAdded docs to performance gate.
Comment #15
webchickAwesome, thanks Moshe! :)
Reverted this patch from D8 and D7. And I guess that makes this "won't fix"?
Comment #16
scor commentedthanks webchick. yeah we'll add the cache in contrib directly.
Comment #17
cweagansUpdating tags per http://drupal.org/node/1517250