Subramanya Sastry has uploaded a new change for review.

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

Change subject: DSR: Remove stale/dead conditions in LTR propagation
......................................................................

DSR: Remove stale/dead conditions in LTR propagation

* DSR computation has a check to stop LTR propagation if it
  won't change anything. This check is present to prevent
  O(n^2) behavior where n = # of children of a node.

  However, we had 2 stale checks which had no role in propagating
  information but were preventing the LTR propagation from terminating.
  The net effect was that in some scenarios, this resulted in
  O(n^2) behavior since for every child that was encountered in
  the RTL sweep, information was being propagated to all children after!

  These checks have lingered around since Dec 2012 at least.

* Encountered this while debugging timeout on iawikibooks:Interlexico_c

Change-Id: I8fe0280f19ad4c27e7a0ead43ecb36dc4708911f
---
M lib/dom.computeDSR.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/88/244588/1

diff --git a/lib/dom.computeDSR.js b/lib/dom.computeDSR.js
index 5229ffe..c4692a3 100644
--- a/lib/dom.computeDSR.js
+++ b/lib/dom.computeDSR.js
@@ -496,7 +496,7 @@
                                                newCE = newCE + 
DU.decodedCommentLength(sibling);
                                        } else if (nType === node.ELEMENT_NODE) 
{
                                                var siblingDP = 
DU.getDataParsoid(sibling);
-                                               if (siblingDP.dsr && 
siblingDP.tsr && siblingDP.dsr[0] <= newCE && e !== null) {
+                                               if (siblingDP.dsr && 
siblingDP.dsr[0] <= newCE) {
                                                        // sibling's dsr wont 
change => ltr propagation stops here.
                                                        break;
                                                }

-- 
To view, visit https://gerrit.wikimedia.org/r/244588
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8fe0280f19ad4c27e7a0ead43ecb36dc4708911f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to