Files
Josh StoryandGitHub fa58002262 [Fizz] Pipeable Stream Perf (#24291)
* Add fixture for comparing baseline render perf for renderToString and renderToPipeableStream

Modified from ssr2 and https://github.com/SuperOleg39/react-ssr-perf-test

* Implement buffering in pipeable streams

The previous implementation of pipeable streaming (Node) suffered some performance issues brought about by the high chunk counts and innefficiencies with how node streams handle this situation. In particular the use of cork/uncork was meant to alleviate this but these methods do not do anything unless the receiving Writable Stream implements _writev which many won't.

This change adopts the view based buffering techniques previously implemented for the Browser execution context. The main difference is the use of backpressure provided by the writable stream which is not implementable in the other context. Another change to note is the use of standards constructs like TextEncoder and TypedArrays.

* Implement encodeInto during flushCompletedQueues

encodeInto allows us to write directly to the view buffer that will end up getting streamed instead of encoding into an intermediate buffer and then copying that data.
2022-04-11 09:13:44 -07:00

182 lines
4.7 KiB
JavaScript

export default function BigComponent() {
return (
<article>
<section>
<h2>Description</h2>
<p>
This page has repeating sections purposefully to create very large
trees that stress the rendering and streaming capabilities of Fizz
</p>
</section>
<section>
<h2>Another Section</h2>
<p>this section has a list</p>
<ul>
<li>item one</li>
<li>item two</li>
<li>item three</li>
<li>item four</li>
<li>item five</li>
</ul>
<p>it isn't a very interesting list</p>
</section>
<section>
<h2>Smiley Section</h2>
<p>here is a list of smiley emojis</p>
<ol>
<li>😀</li>
<li>😃</li>
<li>😄</li>
<li>😁</li>
<li>😆</li>
<li>😅</li>
<li>😂</li>
<li>🤣</li>
<li>🥲</li>
<li>☺️</li>
<li>😊</li>
<li>😇</li>
<li>🙂</li>
<li>🙃</li>
<li>😉</li>
<li>😌</li>
<li>😍</li>
<li>🥰</li>
<li>😘</li>
<li>😗</li>
<li>😙</li>
<li>😚</li>
<li>😋</li>
<li>😛</li>
<li>😝</li>
<li>😜</li>
<li>🤪</li>
<li>🤨</li>
<li>🧐</li>
<li>🤓</li>
<li>😎</li>
<li>🥸</li>
<li>🤩</li>
<li>🥳</li>
<li>😏</li>
<li>😒</li>
<li>😞</li>
<li>😔</li>
<li>😟</li>
<li>😕</li>
<li>🙁</li>
<li>☹️</li>
<li>😣</li>
<li>😖</li>
<li>😫</li>
<li>😩</li>
<li>🥺</li>
<li>😢</li>
<li>😭</li>
<li>😤</li>
<li>😠</li>
<li>😡</li>
<li>🤬</li>
<li>🤯</li>
<li>😳</li>
<li>🥵</li>
<li>🥶</li>
<li>😱</li>
<li>😨</li>
<li>😰</li>
<li>😥</li>
<li>😓</li>
<li>🤗</li>
<li>🤔</li>
<li>🤭</li>
<li>🤫</li>
<li>🤥</li>
<li>😶</li>
<li>😐</li>
<li>😑</li>
<li>😬</li>
<li>🙄</li>
<li>😯</li>
<li>😦</li>
<li>😧</li>
<li>😮</li>
<li>😲</li>
<li>🥱</li>
<li>😴</li>
<li>🤤</li>
<li>😪</li>
<li>😵</li>
<li>🤐</li>
<li>🥴</li>
<li>🤢</li>
<li>🤮</li>
<li>🤧</li>
<li>😷</li>
<li>🤒</li>
<li>🤕</li>
<li>🤑</li>
<li>🤠</li>
<li>😈</li>
<li>👿</li>
<li>👹</li>
<li>👺</li>
<li>🤡</li>
<li>💩</li>
<li>👻</li>
<li>💀</li>
<li>☠️</li>
<li>👽</li>
<li>👾</li>
<li>🤖</li>
<li>🎃</li>
<li>😺</li>
<li>😸</li>
<li>😹</li>
<li>😻</li>
<li>😼</li>
<li>😽</li>
<li>🙀</li>
<li>😿</li>
<li>😾</li>
</ol>
</section>
<section>
<h2>Translation Section</h2>
<p>This is the final section you will see before the sections repeat</p>
<p>
English: This is a text block translated from English to another
language in Google Translate.
</p>
<p>
Korean: 이것은 Google 번역에서 영어에서 다른 언어로 번역된 텍스트
블록입니다.
</p>
<p>
Hindi: यह Google अनुवाद में अंग्रेज़ी से दूसरी भाषा में अनुवादित
टेक्स्ट ब्लॉक है।
</p>
<p>
Lithuanian: Tai teksto blokas, išverstas iš anglų kalbos į kitą
„Google“ vertėjo kalbą.
</p>
<div>
<div>
<div>
<div>
<div>
<div>
<span>
we're deep in some nested divs here, not that you can tell
visually
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</article>
);
}