Created
October 17, 2019 12:22
-
-
Save pzp1997/49755cfc91af327554d5a9aa1cb65dd0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// COUNTERS FOR INSTRUMENTATION | |
var refEqSkippedNodes, refEqSkippedDescendants; | |
function _VirtualDom_diff(x, y) | |
{ | |
var patches = []; | |
refEqSkippedNodes = 0; | |
refEqSkippedDescendants = 0; | |
_VirtualDom_diffHelp(x, y, patches, 0); | |
console.log("skipped diff for " + refEqSkippedNodes + " nodes (REF EQ)"); | |
console.log("skipped diff for " + refEqSkippedDescendants + " descendants (REF EQ)"); | |
return patches; | |
} | |
function _VirtualDom_diffHelp(x, y, patches, index) | |
{ | |
if (x === y) | |
{ | |
refEqSkippedNodes++; | |
refEqSkippedDescendants += (x.__descendantsCount || 0); | |
return; | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment