Information about the wiki (https://allthetropes.org, hosted by wiki farm Miraheze):
MediaWiki: 1.34.2
PHP: 7.3.19-1~deb10u1 (fpm-fcgi)
MariaDB: 10.4.13-MariaDB-1:10.4.13+maria~buster-log
StructuredDiscussions: 5a1c2eb72f15a29dcc96ad5f3a5a59e88bd1aa00 (branch REL1_34)
When I would like to view my own contributions (Special:Contributions/Southparkfan), I noticed via tideways profiling about 50% of the parse time is spent in the MediaWiki hooks. Since there is no overview available of cumulative time spent per hook event, I decided to hack something on my own. My conclusion was that the StructuredDiscussions hook onContributionsLineEnding has a major effect on Special:Contributions, see profile P12202. Multiple refreshes give me 19-23% for onContributionsLineEnding.
Since Wikimedia uses StructuredDiscussions as well, I decided to get some profiles Wikimedia as well. Thanks to @dpifke, we have an XHGui profile of https://mediawiki.org/wiki/Special:Contributions/Southparkfan: https://performance.wikimedia.org/xhgui/run/view?id=5f2de5c63f3dfad15b2fb491. A few statistics (including HookContainer::run, to see how much time inside all hook runs is spent by the Flow hook) for various wikis:
- https://mediawiki.org/wiki/Special:Contributions/Southparkfan (Flow enabled)
- Request 1
- 1071.020 1 - wfIndexMain
- 488.974 2486 - MediaWiki\HookContainer\HookContainer::run
- 232.728 50 - MediaWiki\HookContainer\HookRunner::onContributionsLineEnding
- Request 2
- 1059.365 1 - wfIndexMain
- 491.729 2486 - MediaWiki\HookContainer\HookContainer::run
- 236.658 50 - MediaWiki\HookContainer\HookRunner::onContributionsLineEnding
- Request 3
- 1224.778 1 - wfIndexMain
- 532.531 2486 - MediaWiki\HookContainer\HookContainer::run
- 247.485 50 - MediaWiki\HookContainer\HookRunner::onContributionsLineEnding
- Request 1
- https://en.wikipedia.org/wiki/Special:Contributions/Southparkfan (Flow enabled)
- Request 1
- 888.130 1 - wfIndexMain
- 192.427 2872 - MediaWiki\HookContainer\HookContainer::run
- Request 2
- 723.839 1 - wfIndexMain
- 165.677 2871 - MediaWiki\HookContainer\HookContainer::run
- Request 3
- 802.282 1 - wfIndexMain
- 193.255 2871 - MediaWiki\HookContainer\HookContainer::run
- Request 1
Conclusions:
- On mediawikiwiki, about 43%-46% of the time is spent running hooks, compared to 21%-24% on enwiki.
- About 46%-48% of the execution time while running hooks is consumed by the StructuredDiscussions onContributionsLineEnding hook.
- If you subtract the wall time of MediaWiki\HookContainer\HookRunner::onContributionsLineEnding from mediawikiwiki's wfIndexMain, the total execution time is very similar to enwiki's.
- All above points are also found on Miraheze wikis, reducing the likelihood of a Wikimedia-only issue.