From 55266e0daa23ae5b335dca389449da322a4752b1 Mon Sep 17 00:00:00 2001 From: Thomas Hintz Date: Sun, 26 Jul 2020 15:03:19 -0700 Subject: [PATCH] Testing superscript and subscript export to Markua. --- high-performance-react.org | 2 +- manuscript/fundamentals--building-our-own-react.markua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/high-performance-react.org b/high-performance-react.org index 286a5b1..9ca4ea5 100644 --- a/high-performance-react.org +++ b/high-performance-react.org @@ -409,7 +409,7 @@ Unfortunately those researching tree diffing in Computer Science have not yet produced a generic algorithm with sufficient performance for use in something like React as the current best still runs in O(n^3). This leads to the largest performance related aspect in all of -React. +React. H_2O Since an O(n^3) algorithm isn't going to cut it the creators of React instead use a set of heuristics to determine what parts of the tree diff --git a/manuscript/fundamentals--building-our-own-react.markua b/manuscript/fundamentals--building-our-own-react.markua index 5db8ea9..f74ce6f 100644 --- a/manuscript/fundamentals--building-our-own-react.markua +++ b/manuscript/fundamentals--building-our-own-react.markua @@ -201,9 +201,9 @@ A tale of two trees. These are the two trees that people most often talk about w Conceptually the way this works is that React generates a new element tree for every render and compares to the newly generated tree to the tree generated on the previous render. Where it finds differences in the tree it knows to mutate the DOM state. This is the "tree diffing" algorithm. -Unfortunately those researching tree diffing in Computer Science have not yet produced a generic algorithm with sufficient performance for use in something like React as the current best still runs in O(n3). This leads to the largest performance related aspect in all of React. +Unfortunately those researching tree diffing in Computer Science have not yet produced a generic algorithm with sufficient performance for use in something like React as the current best still runs in O(n^3^). This leads to the largest performance related aspect in all of React. H~2O~ -Since an O(n3) algorithm isn't going to cut it the creators of React instead use a set of heuristics to determine what parts of the tree have changed. Understanding how the React tree diffing algorithm works in general and the heuristics currently in use can help immensely in detecting and fixing React performance bottlenecks. And beyond that it can help one's understanding of some of React's quirks and usage. Even though this algorithm is internal to React and can be changed anytime its details have leaked out in some ways and are overall unlikely to change in major ways without larger changes to React. +Since an O(n^3^) algorithm isn't going to cut it the creators of React instead use a set of heuristics to determine what parts of the tree have changed. Understanding how the React tree diffing algorithm works in general and the heuristics currently in use can help immensely in detecting and fixing React performance bottlenecks. And beyond that it can help one's understanding of some of React's quirks and usage. Even though this algorithm is internal to React and can be changed anytime its details have leaked out in some ways and are overall unlikely to change in major ways without larger changes to React. According to the React documentation their diffing algorithm is O(n) and based on two major components: