<story><title>Netflix: Removing client-side React.js improved performance by 50%</title><url>https://twitter.com/NetflixUIE/status/923374215041912833</url></story><parent_chain><item><author>clarle</author><text>Hey, I work on the team at Netflix that gave the talk on React in the signup flow in the tweet.&lt;p&gt;The full talks are available here if people want to watch them:&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.youtube.com&amp;#x2F;watch?v=V8oTJ8OZ5S0&amp;amp;t=11m30s&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;www.youtube.com&amp;#x2F;watch?v=V8oTJ8OZ5S0&amp;amp;t=11m30s&lt;/a&gt;&lt;p&gt;Thought I&amp;#x27;d also provide some more context on some common questions that people have asked.&lt;p&gt;### Why are you using React to render a landing page?&lt;p&gt;The Netflix landing page is a lot more dynamic than most people think it is.&lt;p&gt;It&amp;#x27;s our most heavily A&amp;#x2F;B-tested page in the signup flow, with even some machine learning models being used to customize the messaging and imagery that you get depending on location, whether or not you were a previous Netflix member, device type, and a lot more.  Even beyond that, Netflix supports almost 200 countries now, and there&amp;#x27;s a different combination of localization, legal challenges, and value messaging for each one.  We end up sharing a lot of the logic and UI for these A&amp;#x2F;B testing and localization challenges throughout the signup flow, mainly through React components.&lt;p&gt;The example I always love to give is the &amp;lt;TermsOfUse&amp;#x2F;&amp;gt; component that we have, which to a Netflix customer signing up is literally one or two checkboxes on the UI, but has some of the most complicated logic in the codebase due to the vast number of countries and user states we support.  Because of all this, it&amp;#x27;s more valuable for us to share these common React components across the entire signup process, both the landing page and the rest of the flow, which is a single-page React and Redux application.&lt;p&gt;We&amp;#x27;ve seen a lot of conversion value though in improving the performance of the landing page, especially in countries with slower connections, but we don&amp;#x27;t also want to re-duplicate a lot of the shared UI logic that we have.&lt;p&gt;The tradeoff that we decided to make is to server-render the landing page using React, but also pre-fetching React &amp;#x2F; Redux &amp;#x2F; the code for the rest of the signup flow while on it.  This optimizes first load performance, but also optimizes the time to load for the rest of the signup flow, which has a much larger JS bundle size to download since it&amp;#x27;s a single-page app.&lt;p&gt;### What&amp;#x27;s the performance metric that&amp;#x27;s being used?&lt;p&gt;It&amp;#x27;s TTI (Time to Interactive), when the user can fully interact with the page.  This is different than TTR (Time to Render) for us, when the user can fully view the page.  There&amp;#x27;s more information in the talk about the differences.&lt;p&gt;### Why not Service Workers or some other pre-loading &amp;#x2F; caching mechanism?&lt;p&gt;We have been experimenting with it, but it&amp;#x27;s mainly the lack of some browser support - Safari is the main one.  Generally the Netflix signup flow needs to have more legacy browser support than the Netflix member experience.  Lots of people sign up on a pretty old browser, but only ever watch Netflix on the native mobile apps or a TV device.&lt;p&gt;#####&lt;p&gt;Feel free to comment here or tweet at Tony (&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;twitter.com&amp;#x2F;tedwards947&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;twitter.com&amp;#x2F;tedwards947&lt;/a&gt;) or me (&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;twitter.com&amp;#x2F;clarler&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;twitter.com&amp;#x2F;clarler&lt;/a&gt;) if there&amp;#x27;s any other questions that we can help answer.&lt;p&gt;Though from a lot of experience, 140 characters isn&amp;#x27;t always enough to provide enough context for JavaScript framework discussions. ;)&lt;p&gt;If these sort of performance and UI challenges seem interesting to you, our team is also hiring for UI engineers and an engineering manager!&lt;p&gt;* Senior Software Engineer (React, Node): &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;jobs.netflix.com&amp;#x2F;jobs&amp;#x2F;864767&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;jobs.netflix.com&amp;#x2F;jobs&amp;#x2F;864767&lt;/a&gt;&lt;p&gt;* Senior Software Engineer (Android): &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;jobs.netflix.com&amp;#x2F;jobs&amp;#x2F;864766&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;jobs.netflix.com&amp;#x2F;jobs&amp;#x2F;864766&lt;/a&gt;&lt;p&gt;* Engineering Manager: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;jobs.netflix.com&amp;#x2F;jobs&amp;#x2F;865119&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;jobs.netflix.com&amp;#x2F;jobs&amp;#x2F;865119&lt;/a&gt;&lt;p&gt;Cheers!</text></item></parent_chain><comment><author>spicyj</author><text>I work on React. We’d love to hear from your team sometimes and collaborate on this sort of thing. We’re solving many of the same problems but I rarely hear from Netflix engineers except at talks when announcing they’re avoiding React or have forked it, often for reasons we weren’t even aware of.</text></comment>
<story><title>Netflix: Removing client-side React.js improved performance by 50%</title><url>https://twitter.com/NetflixUIE/status/923374215041912833</url></story><parent_chain><item><author>clarle</author><text>Hey, I work on the team at Netflix that gave the talk on React in the signup flow in the tweet.&lt;p&gt;The full talks are available here if people want to watch them:&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.youtube.com&amp;#x2F;watch?v=V8oTJ8OZ5S0&amp;amp;t=11m30s&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;www.youtube.com&amp;#x2F;watch?v=V8oTJ8OZ5S0&amp;amp;t=11m30s&lt;/a&gt;&lt;p&gt;Thought I&amp;#x27;d also provide some more context on some common questions that people have asked.&lt;p&gt;### Why are you using React to render a landing page?&lt;p&gt;The Netflix landing page is a lot more dynamic than most people think it is.&lt;p&gt;It&amp;#x27;s our most heavily A&amp;#x2F;B-tested page in the signup flow, with even some machine learning models being used to customize the messaging and imagery that you get depending on location, whether or not you were a previous Netflix member, device type, and a lot more.  Even beyond that, Netflix supports almost 200 countries now, and there&amp;#x27;s a different combination of localization, legal challenges, and value messaging for each one.  We end up sharing a lot of the logic and UI for these A&amp;#x2F;B testing and localization challenges throughout the signup flow, mainly through React components.&lt;p&gt;The example I always love to give is the &amp;lt;TermsOfUse&amp;#x2F;&amp;gt; component that we have, which to a Netflix customer signing up is literally one or two checkboxes on the UI, but has some of the most complicated logic in the codebase due to the vast number of countries and user states we support.  Because of all this, it&amp;#x27;s more valuable for us to share these common React components across the entire signup process, both the landing page and the rest of the flow, which is a single-page React and Redux application.&lt;p&gt;We&amp;#x27;ve seen a lot of conversion value though in improving the performance of the landing page, especially in countries with slower connections, but we don&amp;#x27;t also want to re-duplicate a lot of the shared UI logic that we have.&lt;p&gt;The tradeoff that we decided to make is to server-render the landing page using React, but also pre-fetching React &amp;#x2F; Redux &amp;#x2F; the code for the rest of the signup flow while on it.  This optimizes first load performance, but also optimizes the time to load for the rest of the signup flow, which has a much larger JS bundle size to download since it&amp;#x27;s a single-page app.&lt;p&gt;### What&amp;#x27;s the performance metric that&amp;#x27;s being used?&lt;p&gt;It&amp;#x27;s TTI (Time to Interactive), when the user can fully interact with the page.  This is different than TTR (Time to Render) for us, when the user can fully view the page.  There&amp;#x27;s more information in the talk about the differences.&lt;p&gt;### Why not Service Workers or some other pre-loading &amp;#x2F; caching mechanism?&lt;p&gt;We have been experimenting with it, but it&amp;#x27;s mainly the lack of some browser support - Safari is the main one.  Generally the Netflix signup flow needs to have more legacy browser support than the Netflix member experience.  Lots of people sign up on a pretty old browser, but only ever watch Netflix on the native mobile apps or a TV device.&lt;p&gt;#####&lt;p&gt;Feel free to comment here or tweet at Tony (&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;twitter.com&amp;#x2F;tedwards947&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;twitter.com&amp;#x2F;tedwards947&lt;/a&gt;) or me (&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;twitter.com&amp;#x2F;clarler&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;twitter.com&amp;#x2F;clarler&lt;/a&gt;) if there&amp;#x27;s any other questions that we can help answer.&lt;p&gt;Though from a lot of experience, 140 characters isn&amp;#x27;t always enough to provide enough context for JavaScript framework discussions. ;)&lt;p&gt;If these sort of performance and UI challenges seem interesting to you, our team is also hiring for UI engineers and an engineering manager!&lt;p&gt;* Senior Software Engineer (React, Node): &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;jobs.netflix.com&amp;#x2F;jobs&amp;#x2F;864767&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;jobs.netflix.com&amp;#x2F;jobs&amp;#x2F;864767&lt;/a&gt;&lt;p&gt;* Senior Software Engineer (Android): &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;jobs.netflix.com&amp;#x2F;jobs&amp;#x2F;864766&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;jobs.netflix.com&amp;#x2F;jobs&amp;#x2F;864766&lt;/a&gt;&lt;p&gt;* Engineering Manager: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;jobs.netflix.com&amp;#x2F;jobs&amp;#x2F;865119&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;jobs.netflix.com&amp;#x2F;jobs&amp;#x2F;865119&lt;/a&gt;&lt;p&gt;Cheers!</text></item></parent_chain><comment><author>pluma</author><text>So in other words: the main reason removing the React code in the frontend in this case gave such an immense performance benefit is that the logic used to compute the rendered UI is significantly more complex than the logic necessary to make that UI interactive.&lt;p&gt;It&amp;#x27;s not React that&amp;#x27;s slow, it&amp;#x27;s the logic needed to render the page?</text></comment>