Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
You need to check at least once per request whether the active theme you use is enabled.
Currently this is done by loading all themes.
Proposed resolution
Just load one of them.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#17 | histogram_interleaved.png | 9.29 KB | Wim Leers |
#17 | histogram_facet.png | 9.61 KB | Wim Leers |
#11 | interdiff.txt | 818 bytes | claudiu.cristea |
#10 | 2538970-10.patch | 4.09 KB | claudiu.cristea |
Comments
Comment #1
dawehnerNote, this improves not nothing, but it doesn't change the overall time yet, because #2531958: Try to do less in theme_get_settings() on every request also lists all of it.
Diff%
Diff
(microsec)
Diff%
MemUse
Diff
(bytes)
Diff%
PeakMemUse
Diff
(bytes)
Diff%
Comment #2
Fabianx CreditAttribution: Fabianx as a volunteer and at Tag1 Consulting commentedIs there a patch to review?
Comment #3
dawehnerEhm sure here it is. Ignore the NID of the patch :)
Comment #5
Fabianx CreditAttribution: Fabianx as a volunteer and at Tag1 Consulting commentedLooks great, just need to fix the test failures.
Comment #6
claudiu.cristeaThe problem with the tests is because of the architecture of
ThemeInitialization::getActiveThemeByName()
. WhenThemeInitialization::getActiveThemeByName()
tries to return a theme that is not installed he callsThemeInitialization::getActiveTheme()
with a fake theme calledcore
. From my point of view this a bad design but this is not subject of this issue.Comment #7
claudiu.cristeaForgot the interdiff.
Comment #8
dawehnerGood observation ... I'll dig into that later, but yeah we should fix the design there properly.
Comment #9
dawehnerDo you mind opening up an issue for that?
So if its core its disabled? We should have a least some form of documentation
Comment #10
claudiu.cristeaNew issue created #2545192: Don't assign 'core' to a theme that cannot be negotiated or is not in the installed theme list.
Added some docs as you suggested in #9.
Comment #11
claudiu.cristeaOuch!
Comment #13
claudiu.cristeaAccidentally I added the same patch twice in #10. Back to NR.
Comment #14
dawehnerThis looks alright for me now, but yeah I fear we need to provide some benchmarking + beta evaluation to judge whether this is useful.
Note: if you have more themes enabled, (which is the workflow if you have the themekey module, you end up in those kind of problems
Comment #15
claudiu.cristea@dawehner, can you point me to some docs, best practices, writeups on how to provide an acceptable benchmark?
Comment #16
claudiu.cristeaComment #17
Wim LeersI'm afraid this is a dead end :(
EDIT: tested with 1000 requests to
/contact
, as the anon users, with page cache off.Comment #18
dawehnera) to be clear #2531958: Try to do less in theme_get_settings() on every request still has a listInfo call, so this is why things are a bit slower here
b) This doesn't tell us any statistically relevant data, see standard derivation. We need to have more iterations in order to tell something properly
Comment #19
joelpittetHere's what I got with the
/contact
as the front page. xdebug and all caching turned off. Twig debug turned off and twig caching still on.Also I enabled all the modules and a few contrib modules too but still accessing that page anonymous so it shouldn't make I difference I'd expect.
http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=5659123816918&...
http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=5659123816918&...
http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=565918537d922&... 8_0_x-summary..themeaccesscheck-summary
Comment #24
joelpittet@claudiu.cristea is there something else we could test directly because page hits aren't significantly different it seems from the tests above.
Setting to NW for update to profiling scenario/instructions.