Page MenuHomePhabricator

Consider using instanceof checks for DOM Nodes instead of DOMUtils::is* + DOMUtils::assertElt combinations
Closed, ResolvedPublic

Description

instanceof checks to test for text / element / comment node is much cheaper than using DOMUtils::is* helpers along with a DOMUtils::assertElt helper to satisfy phan.

Event Timeline

ssastry created this task.May 14 2019, 4:20 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 14 2019, 4:20 AM
ssastry triaged this task as Medium priority.May 14 2019, 4:20 AM
ssastry moved this task from Backlog to Performance on the Parsoid-PHP board.

Change 533258 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/services/parsoid@master] Replace DOMUtils::isElt && assertElt(..) combo with instanceof checks

https://gerrit.wikimedia.org/r/533258

Change 533258 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Replace DOMUtils::isElt && assertElt(..) combo with instanceof checks

https://gerrit.wikimedia.org/r/533258

Sbailey closed this task as Resolved.Oct 9 2019, 10:35 PM
Sbailey claimed this task.
Sbailey added a subscriber: Sbailey.

After reviewing Parsoid/PHP on Oct, 9, it appears that all performance improvements possible were addressed by:
https://gerrit.wikimedia.org/r/533258

Change 606258 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Replace some instances of DOMUtils::assertElt

https://gerrit.wikimedia.org/r/606258

Change 606258 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Replace some instances of DOMUtils::assertElt

https://gerrit.wikimedia.org/r/606258