Problem/Motivation
Noticed while working on #2429617: Make D8 2x as fast: Dynamic Page Cache: context-dependent page caching (for *all* users!).
- The use of the
ElementInfoManagerservice is useless. - The
CacheContextsManagerservice is unused.
This would help #2429617: Make D8 2x as fast: Dynamic Page Cache: context-dependent page caching (for *all* users!) be simpler.
Proposed resolution
Remove both.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Beta phase evaluation
| Issue category | Bug because unused injected services are a potential performance problem, but at least they decrease maintainability. |
|---|---|
| Issue priority | Normal because just some cleanup. |
| Prioritized changes | The main goal of this issue is to help a performance issue be easier and to cleanup unused services to help maintainability. |
| Disruption | Likely not disruptive for contrib as overriding HtmlRenderer is not yet so common. |
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | simplify-htmlrenderer-2493021-14.patch | 4.67 KB | wim leers |
Comments
Comment #1
wim leersComment #2
wim leersFor completeness: this is the part that neither Fabianx nor I know what purpose its serves.
To the best of my knowledge, it is related to #2352155-64: Remove HtmlFragment/HtmlPage, but I can't tell if it's truly (still) necessary.
If it passes, it isn't necessary anymore. If it doesn't pass, it is, and we can investigate :)
Comment #3
wim leersTests passed; this is good to go.
Comment #4
dawehnerHow the
Comment #5
dawehner.
Comment #6
fabianx commentedUhm, so why do we not remove the @cache_contexts_manager here as well?
Comment #7
tim.plunkettThat elementInfo line is supposed to add in the defaults for the
'#type' => 'html'element, see \Drupal\Core\Render\Element\Html::getInfo():Additionally, someone could alter the definition and add their own #pre_render or something...
Comment #8
fabianx commentedComment #9
fabianx commented#7: Correct, but Renderer::doRender() does that already for us automatically, so we should not need to special case that. We don't need to special case it anywhere else in core.
Comment #10
wim leersComment #11
fabianx commentedA new patch removing the context definition as well.
Comment #12
fabianx commentedAlright, Wim wins! :)
Comment #13
dawehner... Now that we remove the usages, YEAH, let's also drop the use statements ...
Comment #14
wim leersDone, plus one more unused use statement.
Comment #15
wim leersComment #18
wim leersTestbot--
Comment #19
alexpottCommitted 83b9aa8 and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation to the issue summary.