Ed and I have already sneaked in this work and worked out the details in Gerrit, filing a task for ease of reference, just in case we break something.
Motivation:
Ed and I have already sneaked in this work and worked out the details in Gerrit, filing a task for ease of reference, just in case we break something.
Motivation:
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Restricted Task | |||||
| Restricted Task | |||||
| Restricted Task | |||||
| Resolved | None | T396248 Update the DiscussionTools post-cache HTML pass to use Remex instead of regexes |
Change #1148378 had a related patch set uploaded (by Bartosz Dziewoński; author: Esanders):
[mediawiki/extensions/DiscussionTools@master] Use custom elements for content placeholders, with HtmlHelper::modifyElement
Change #1154332 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):
[mediawiki/extensions/DiscussionTools@master] Remove cache compat code for content placeholders
Change #1148378 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] Use custom elements for content placeholders, with HtmlHelper::modifyElement
Change #1154332 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] Remove cache compat code for content placeholders
I suspect https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DiscussionTools/+/1148378 is causing MediaWiki\Extension\DiscussionTools\Hooks\PageHooks::onOutputPageBeforeHTML to run on every normal article page. From the flame graph archive at https://performance.wikimedia.org/php-profiling/, this function is barely visible on 2025-06-13, but begins to call BatchModifyElements::apply and RemexHtml after 2025-06-14. The time wasted by this is considerable on long pages.
Interesting, thanks for letting us know. I started a new task for this, and replied there: T400115: Possible performance issue in DiscussionTools
Pardon me for asking another question here. I sometimes feel a bit annoyed by the time taken for the OutputPageBeforeHTML hook, as it can take more than 1s on some large talk pages (length alone might not be the problem, probably also related to the number of signatures), and the result is not cached. Is it inevitable by design, or already tracked somewhere in another ticket?
@Bewfip I don't think it can be cached, or at least not very effectively; the result depends on the current time (for the relative time display), and also on the user viewing it (for the state of topic subscriptions and presence of thanks buttons). A whole second is a lot slower than I would expect it to be though, even on large pages; I recorded a profile and there are some possible improvements. I started another new task for this: T405135: Optimize DiscussionTools OutputPageBeforeHTML hook handler (2025)
Change #1192211 had a related patch set uploaded (by Reedy; author: Esanders):
[mediawiki/extensions/DiscussionTools@REL1_44] Use custom elements for content placeholders, with HtmlHelper::modifyElement
Change #1192214 had a related patch set uploaded (by Reedy; author: Esanders):
[mediawiki/extensions/DiscussionTools@REL1_43] Use custom elements for content placeholders, with HtmlHelper::modifyElement
It would seem this goes back to MW-1.39-release... rEDTOda64c43ccca8: Show thread metadata in section headers for T269950: [EPIC] Topic Containers...
Change #1192211 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@REL1_44] Use custom elements for content placeholders, with HtmlHelper::modifyElement
Change #1192221 had a related patch set uploaded (by Reedy; author: Bartosz Dziewoński):
[mediawiki/extensions/DiscussionTools@REL1_44] Remove cache compat code for content placeholders
Change #1192221 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@REL1_44] Remove cache compat code for content placeholders
Change #1192255 had a related patch set uploaded (by Reedy; author: Bartosz Dziewoński):
[mediawiki/extensions/DiscussionTools@REL1_43] Remove cache compat code for content placeholders
Change #1192214 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@REL1_43] Use custom elements for content placeholders, with HtmlHelper::modifyElement
Change #1192255 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@REL1_43] Remove cache compat code for content placeholders