You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building the CSSOM tree, the rendering is blocked until the CSSOM tree is built. And building the CSSOM tree is a very cost-intensive process, so you should try to ensure that the level is flat and reduce excessive cascading. The more specific the CSS selector is, the slower the execution.
469
469
470
470
When the HTML is parsing the script tag, the DOM is paused and will restart from the paused position. In other words, the faster you want to render the first screen, the less you should load the JS file on the first screen. And CSS will also affect the execution of JS. JS will only be executed when the stylesheet is parsed. Therefore, it can be considered that CSS will also suspend the DOM in this case.
@@ -586,4 +586,4 @@ for(let i = 0; i < 1000; i++) {
586
586
587
587
- As we know that the layer will prevent the changed node from affecting others, so it is good practice to create a new layer for animations with high frequency.
A queue is a linear data structure. The insertion takes place at one end while the deletion occurs the other one. And the operation should obey the rules FIFO(First In First Out).
The linked list is a linear data structure and born to be recursive structure. It can fully use the memory of the computer and manage the memory dynamically and flexibly. But Nodes in the linked list must be read in order from the beginning which can be random in the array, and it uses more memory than the array because of the storage used by their pointers.
@@ -291,15 +291,15 @@ Binary Tree is a common one of the many structures of the tree. And it is born t
291
291
292
292
Binary tree start at a root node and each node consists of two child-nodes at most: left node and right node. The nodes in the bottom are usually called leaf nodes, and when the leaf nodes is full, we call the Full Binary Tree.
Binary Search Tree (BST) is one of the binary trees, so it has all the features of the binary tree. But different with the binary tree, the value in any node is larger than the values in all nodes in that node's left subtree and smaller than the values in all nodes in that node's right subtree.
299
299
300
300
This storage method is very suitable for data search. As shown below, when you need to find 6, because the value you need to find is larger than the value of the root node, you only need to find it in the right subtree of the root node, which greatly improves the search efficiency.
As for l-l(left-left), the new node T1 is in the left side of the node X. The tree cannot keep balance by now, so there need to rotate. After rotating, the tree should still obey the rules the mid is bigger than the left and less than the right according to the features of the BST.
582
582
@@ -720,7 +720,7 @@ Simply, this data structure is used to search string easily, with the following
720
720
- all nodes do not store a character, and only the path store, this is different from other tree structures.
721
721
- the character in the path from the root to the random node can combine to the strings corresponding to the node
@@ -878,7 +878,7 @@ The key of `shiftUp` is to compare with the parent node bubbly and exchange the
878
878
879
879
As for `shiftDown`, first exchange root and the tail node, and then delete the tail. After that, Compare with the parent node and both child-nodes circularly, if the child-node is larger, assign the parent node with the larger node.
Copy file name to clipboardExpand all lines: Framework/framework-br.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -258,11 +258,11 @@ As rotas no front-end é atualmente simples de implementar. A essência é escut
258
258
259
259
`www.test.com/#/` é a hash URL. Quando o valor depois do hash `#` muda, nenhuma request será enviada ao servidor. Você pode escutar as mudanças na URL através do evento `hashchange`, e então pular para a página correspondente.
Copy file name to clipboardExpand all lines: Framework/framework-en.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -260,11 +260,11 @@ The front-end routing is actually very simple to implement. The essence is to li
260
260
261
261
`www.test.com/#/` is the hash URL. When the hash value after `#` changes, no request will be sent to server. You can listen to the URL change through the `hashchange` event, and then jump to the corresponding page.
Copy file name to clipboardExpand all lines: Framework/react-br.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -15,14 +15,14 @@ O Fiber foi introduzido no lançamento da V16. O mecanismo afeta alguma das cham
15
15
16
16
Nas versões anteriores, se eu tiver um componente composto complexo e então mudar o `state` na camada mais alta do componente, a pilha de chamada poderia ser grande.
Se a pilha de chamada for muito longa, e complicadas operações estiverem no meio, isso pode causar um bloqueio a thread principal por um longe tempo, resultando em uma experiência ruim para o usuário. Fiber nasceu para resolver esse problema.
21
21
22
22
Fiber é na essência uma pilha virtual de quadros, e o novo agendador espontaneamente agenda esses quadros de acordo
23
23
com sua prioridade, desse modo, mudando a renderização síncrona anterior para renderização assíncrona, e segmentando a atualização sem afetar a experiência.
React tem seu proprio conjunto de lógica sobre como priorizar. Para coisas que requerem alta performance em tempo-real, tal como animação, que significa isso deve ser renderizado uma vez dentro de 16 ms para garantir que não está emperrando, React pausa o update a cada 16 ms (dentro de 16 ms) e retorna para continuar renderizando a animação.
Copy file name to clipboardExpand all lines: Framework/react-en.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -15,13 +15,13 @@ The Fiber mechanism was introduced in the V16 release. The mechanism affects som
15
15
16
16
In previous versions, if you had a very complex composite component and then changed the `state` of the topmost component, the call stack might be long.
If the call stack is too long, and complicated operations are performed in the middle, it may cause the main thread to be blocked for a long time, resulting in a bad user experience. Fiber is born to solve this problem.
21
21
22
22
Fiber is essentially a virtual stack frame, and the new scheduler freely schedules these frames according to their priority, thereby changing the previous synchronous rendering to asynchronous rendering, and segmenting the update without affecting the experience.
React has its own set of logic on how to prioritize. For things that require high real-time performance, such as animation, which means it must be rendered once within 16 ms to ensure that it is not stuck, React pauses the update every 16 ms (within 16ms) and returns to continue rendering the animation.
0 commit comments