Convopage
See the entire conversation
Netflix UI Engineers
@NetflixUIE
Removing client-side React.js (but keeping it on the server) resulted in a 50% performance improvement on our landing page
211 replies and sub-replies as of Oct 27 2017
Netflix UI Engineers
@NetflixUIE
And yes, we still ❤️ React and pre-fetch it to use on subsequent steps.
Aleff Souza
@souza_aleff
(No comment)
overflow: heydon
@heydonworks
Unless I'm misunderstanding, I think an even greater performance gain might be had from not pre-fetching that which you don't need?
Tanner Edwards
@TheTedwards
Lorien
@LorienMCS
I'm curious: did you consider anything else, like Preact or Vue? Is it always a trade-off between convenience vs perf with frameworks/libs?
Tony Edwards
@tedwards947
Great question. Yes, we considered preact, but for a simple page w/ low interactivity, using vanillaJS was simpler and easier wrt our stack
Michael Lange
@DingoEatingFuzz
What's the breakdown of where time was saved? Download size? Amount of script to parse and evaluate?
Jason Miller 🦊⚛
@_developit
would be curious to hear a bit more about this too! There's usually a threshold where the weight of preact gets offset by smaller components
Tony Edwards
@tedwards947
primarily download size. we didn't directly measure script parsing time, but 270 vs 35kb of JS ought to be a lot quicker to parse
Kruk Dima
@krkdima
What about pages with high interactivity?
Sunny R. Juneja
@sunnyrjuneja
Curious what you mean by still use it on the server. As a replacement for a templating engine like jade?
Tony Edwards
@tedwards947
For this landing page, you might think of it that way. We just stopped sending React down to the client
Ryan Burgess
@burgessdryan
Plus Jade is actually quite slow
Sunny R. Juneja
@sunnyrjuneja
Thanks, appreciate the response.
Sonal Keshav
@skmexyz
Just to be clear...is this for your
netflix.com
homepage? and anything interactive (login, CTA etc.) is handled by React?
dos
@dos1
Did you consider not using JavaScript when it's not needed? Landing pages need mostly HTML, JS is for additional shininess. Max performance!
Jimmy Fung
@Psisous
is there a link to the slide deck or a recording of the talk?
Yasser A. Hennawi
@YasserHennawi
youtube.com/watch?v=V8oTJ8…
you're welcome
Netflix UI Engineering JS Talks Live Stream
Netflix UI Engineering JS Talks Live Stream
youtube.com
Kevin™
@Nivekkav
Thank you
Sean Roberts
@DevelopSean
Where can I watch this talk?
Yasser A. Hennawi
@YasserHennawi
youtube.com/watch?v=V8oTJ8…
you're welcome
Netflix UI Engineering JS Talks Live Stream
Netflix UI Engineering JS Talks Live Stream
youtube.com
N A V E E N ⚡
@NaveenS16
Will watch this one tonight. Will put this on must watch.
Rafael Wilber Kerr
@rafakerr
Welcome 😎
Sean Roberts
@DevelopSean
yassssss. Thank you!
BK
@bkakadiya42
cc
@conradirwin
swyx 🇸🇬
@swyx
everyone keeps talking about this PlainJS framework, guess I need to learn it. is it on
@npmjs
?
Lorien
@LorienMCS
LOL
Guillaume M.
@MrGuiMan
plainjs.io is available... just saying :D
Adrien Guéret
@AdrienGueret
Did you guys know the framework VanillaJS ?
vanilla-js.com
ɢᴇ𝖔𝖌𝖗𝖊 stephanis
@daljo628
I prefer semicolon.js
this.kms()
@kingdaro_
All the cool kids are using ASI.js 😎
Francois Hattingh
@TMF_at_twitt3r
Semicolon (feat. Solange) - LYRICS VIDEO
Our 2nd vid for YouTube Comedy Week! Download "Semicolon (feat. Solange)" Now! iTunes: http://bit.ly/13w2sxX Amazon: http://bit.ly/11s2V1O Guest Starring MAY...
youtube.com
Satvik
@bozzmob
OMG! Opportunity knocks only once
Gottfried Szing
@GottfriedSzing
Nop, plainjs.io is not available. Someone registered it yesterday. Pretty fast :)
NiKo`
@n1k0
vanilla-js.com
😁
Tony
@iamraje
Classic lol
Cher 👩💻
@codehitchhiker
code_monk
@code_monk
ya bro right here
vanilla-js.com
jason lane
@jayl_ane
i just lol'd
Matt Kenefick
@mattkenefick
Careful with jokes like that... over half of the community will take you seriously because they don't know any better
Shanaullah
@shanaullah786
There is no much dynamic content on Home page so it is a good choice but what was the initial thought for using react for homepage
Jamal Kharrat
@Jamal_2
That's awesome! Congrats :D
Sabarinathan
@riahunter
Is there a recorded version of this talk?
Yasser A. Hennawi
@YasserHennawi
youtube.com/watch?v=V8oTJ8…
you're welcome
Netflix UI Engineering JS Talks Live Stream
Netflix UI Engineering JS Talks Live Stream
youtube.com
Sabarinathan
@riahunter
Thank you :)
wonmin
@jjwonmin
Does "keep it on the server" mean "server-side rendering"~?? 🤓
mr_boombastic
@mr_boombastic
It means they kept some unused React files on the server. (No really, what does it mean? Node?)
Ryan Burgess
@burgessdryan
Server side rendering using Node 😃
Narendra Sisodiya
@nsisodiya
I have done exact same thing in my one set-up.
Björn Sållarp
@bjornsallarp
50% meaning what exactly? From 2ms -> 1ms or 10s -> 5s?
florens
@fvsch
Depends on CPU, network (latency and bandwidth), but it’s probably in the 5–10s ballpark on bad conditions, 1–2s on excellent network.
florens
@fvsch
I have no knowledge of Netflix’s numbers here, but with DNS resolution, TLS handshake, getting HTML, *then* getting sub-resources, and …
florens
@fvsch
… network latencies from 30ms up to 400ms, the lowest numbers for TTI will be in hundreds of ms (and unlikely to ever get <500ms).
florens
@fvsch
Not sure I’ve ever seen TTI < 1000ms. Even if you load the JS inlined in the HTML, parsing/running time can take some more hundreds of ms.
florens
@fvsch
For instance in this test, it took a bit more than 1100ms to get an interactive page:
webpagetest.org/result/171026_…
florens
@fvsch
My local test on desktop (good CPU) + broadband + Firefox got me ~900ms for an interactive page.
sandro
@sandroadamia
agree have not seen either with react stack, though it's possible
github.com/davideast/hnpw…
mentioned here
HNPWA
Hacker News readers as Progressive Web Apps
hnpwa.com
conrad
@zyzDEV
only insane TTI ive seen used webworkers lol
pokedex.org
Christian Nikkanen
@k1sul1
You're forgetting HTTP2.
florens
@fvsch
From what I've read, unless you server-push your CSS and JS with the HTML, the impact on TTI will be limited.
Christian Nikkanen
@k1sul1
Luckily server push is starting to get easier, Netflix probably does it already (too lazy to check).
foolrobot
@foolrobot
Plain javascript Will always be faster than any framework. But you need to better organize it.
Justin Smith
@justintemps
Ok, but to be clear, we're talking about a page with a couple of buttons and some images right?
Andrew Holgate
@andrewholgate
Here's the clincher:
Netflix UI Engineers
@NetflixUIE
And yes, we still ❤️ React and pre-fetch it to use on subsequent steps.
Justin Smith
@justintemps
Make sense if you have a ~static landing page in front of a react app, to render the static part first and then the react part afterwards.
K 👓
@K4y1s
lol, so the TL;DR: "Used React on the client to build a static website and it was faster to use an actual static website" ?
Crysfel
@crysfel
Makes sense! What would you use react to build something like this in a first place!
Nathan Fisher
@natbobc
When you have a hammer...
Ryan Burgess
@burgessdryan
The page had also already been created in React so it was quick not to recreate the page and just remove client side React
Matt Kantor
@mattkantor
Seems about right. No surprise there.
pferdone
@pfrdn
They basically improved their landing page load time to get a little head start so they can pre-fetch the rest of the application in the background.
Justin Smith
@justintemps
I get it. The static stuff all loads react-free so that the react part can load afterwards while there's stuff on the page.
Philippe Back
@philippeback
Next on our programming: "how using server side templates made our day" and "How we made it fly using a custom CSS extension" :-p
Security Toolkit
@websecurify
Why not appcache your landing page? Then you will see some real improvements!
Jon New
@newtang
Do you somehow compile the JS from .jsx files to a vanilla JS file? Or did you just write the vanilla JS and include it?
Tony Edwards
@tedwards947
Nah nothing so fancy. We render the UI on the server w/ React & ship it to the client. client-side interactivity is handled using plain JS
Jon New
@newtang
Got it, that's what I figured. Thanks!
Sandeep Srinivasa
@sandgorgon1
What tools do you use to do SSR ? Have you looked at something like next.js or is this something custom built.
💾 Maxime Kieffer
@MaximeKieffer
Claudio Cicali
@caludio
I would call this technique "Universal" or "Isomorphic". What do you think? 🤔
Rory Ashford-Bentley
@roikles
I would love to see some code examples.
Steven Koch
@stvkoch
until do you need this kind of optimization, do you have run a long way building your business and platform. BTW it's a very good insight!
Zaheer Baloch✌
@zaheerbaloch
😃
Olivier Laviale
@olvlvl
I'd like to see the rest of the slides, because this sounds like people inventing warm water.
Mubaris NK
@Mubaris_NK
Anyone has these slides, pls?
Cezar Pokorski
@ikari
Hmmmm, let's wonder why! :D
Ivan Čurić
@_baxuz
Huh. How do you handle events on the site then? Is it just downcompiled to straight JS, like svelte?
Tony Edwards
@tedwards947
Check out the talk
youtu.be/V8oTJ8OZ5S0
11:30
Netflix UI Engineering JS Talks Live Stream
Netflix UI Engineering JS Talks Live Stream
youtube.com
Nikki
@nikkikom
When they drop it from servers it will be 50% more.
Kolja Kutschera
@KoljaKutschera
There are 2 buttons, text and a logo on the landingpage :D How can you manage the complex state of this elements without flux :DD
Debo Ayangbile
@gbade_a
LMAO
Rob Kent
@robkentzy
There's some great technology called
ASP.NET
which is probably faster :)
The Official Microsoft ASP.NET Site
ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.
asp.net
Umut Karakoç
@umutkarakoc
we are talking about frontend not backend
Sean
@sean____b
I think that was sarcasm 😐
Rob Kent
@robkentzy
If you are talking about my comment, you are being too generous ;)
Daniela Valero
@DanielaValero_
Is there a video for this talk about removing react and improving TTI? Specially in web, context is key to get to understand why it worked
Tony Edwards
@tedwards947
youtu.be/V8oTJ8OZ5S0
11:30 or so!
Netflix UI Engineering JS Talks Live Stream
Netflix UI Engineering JS Talks Live Stream
youtube.com
Rob Belics
@RobBelics
Now remove it on the server and you'll be even faster than that. Along with using FreeBSD as your video server, shows you are pretty smart!
Caio;Incau
@iCaioIncau
Landing page only? Or the entire app?
Tony Edwards
@tedwards947
Landing page only
coffee
@climaco02
(No comment)
Godinho
@MGodinho30
Qual seja o front deles então?!
coffee
@climaco02
js puro
Godinho
@MGodinho30
ai é bad
coffee
@climaco02
kkkjkkkk
Matt Camp
@mattcampux
here we go again
Thiago Caiubi
@thiagocaiubi
ttcu
3Ξ
@3rdEden
TL;DR increased performance by removing a chunk of code/initial payload. That is nothing new :/
Iain van Gardingen
@GiantKiwi
ReactJS and all other equivalents that rely on SS JS, slow and clunky? NEVER... 🙄
Yogesh Lakhotia
@mr_lakhotia
:D
avinash shetty
@nashi007
👍🏻👍🏻👌
Arturo Romero
@arturoromeroslc
npm i -S vanillaJS
Sam Saccone
@samccone
can y'all share some traces? I am curious what the primary cost was. cc
@_jayphelps
Eugene Chekan
@fast_wordpress
++
Da͎̬̩vid Wells ⊂◉‿◉つ
@DavidWells
++
Jay Phelps
@_jayphelps
Cc/
@tedwards947
@burgessdryan
Artyom Trityak
@ArtyomTrityak
i've asked yesterday about "Why not Service Workers" but didn't get an answer. Does anyone have info why not caching via SW?
Ryan Burgess
@burgessdryan
I love service works but the lack of support right now on Safari makes it not as compelling on our side.
Artyom Trityak
@ArtyomTrityak
I agree. It's under development (
bugs.webkit.org/show_bug.cgi?i…
) and can be used with XHR fallback ie use SW or fallback to XHR caching.
Artyom Trityak
@ArtyomTrityak
that's just an idea, i use SW and happy with manual cache control. So i'm not relying on browser cache algorithms but make sure it works
Tony Edwards
@tedwards947
not 100% sure what you mean, can you elaborate a bit so I can better answer?
Lars / LGK
@lgkonline
Just for a landing page there's no need for a framework. But if we speak about a powerful web app I think
@reactjs
is the better choice.
Distortednet
@distortednet
welll...yeah, this is something i would completely expect.
ZaL
@zals07
why did you even choose React for the landing page at the first place ^_^
Pomax
@TheRealPomax
Not having been at the conf - you mean server-side render + react late-loading into the pages, or "no react at all in the client"?
Tony Edwards
@tedwards947
No react on the client for landing page only. Other pages have React. We prefetch resources used by those pages
Hugo Wood
@mercury_wood
What kind of clients are we talking about here? Are TVs & STBs included? Phones? Computers only?
Tony Edwards
@tedwards947
Web only. We’re doing lots of other stuff to optimize perf on other platforms
Josselin Auguste
@josselinauguste
Why the hell were you using react on a landing page ? oO
Chris van Löben Sels
@chrisvls
cc:
@BrianScates
Lucien
@LPGhatguy
Did you compare the hydration improvements in 16.x (~3x server speedup too!) to having no React? I'd expect a similar speedup
Silent Hill Tourism
@mathew
Now please give us a way to turn off autoplay.
Alex Lohr
@lexLohr
These metrics never define what "interactive" actually means. Are links still handled in the same scope or do they trigger a request?
Tony Edwards
@tedwards947
TTI = domInteractive - requestStart (both from window.performance.timing)
Nicklas Pouey-Winger
@NicklasWinger
You guys should as add an engineering channel to your app 🤓
Maurice Williams
@morficus
Can you share some actual numbers (averages) and not just a %? %'s can be misleading (many times on purpose....)
Maurice Williams
@morficus
A TTI reduction from 200ms to 100ms vs 1 second to 500ms.... Both are 50% .... But one is much more meaningful than the other...
Tony Edwards
@tedwards947
Check out the talk
youtu.be/V8oTJ8OZ5S0
starts at 11:30
Netflix UI Engineering JS Talks Live Stream
Netflix UI Engineering JS Talks Live Stream
youtube.com
Branko Zivanovic
@zivanovicb1
So you are talking about this page, right?
Tony Edwards
@tedwards947
Yup
clintm
@hydo
How long before we see "By getting rid of Javascript on the server, we saw a ..."
Tasha Alfano
@tasha_alfano
have you seen this yet?
David Salas
@NotAMolePerson
Yup! Learned new things about win.perf. I've measured TTI manually before and damn was I overcomplicating it 😅. Their way is much easier lol
Steven Wade
@stevenwadejr
“…and moving to plain JavaScript”, I feel like this is a “duh” moment.
unless not
@leandronsp
wow! haters gonna love that you got rid of “heavy React” from a page with two buttons and a bunch of images
Leandro Lourenci
@lourenci
React in a landing page? How do the search engines index that? I am not understanding this...
Tony Edwards
@tedwards947
We render on the server using react as well. Check out my talk:
youtu.be/V8oTJ8OZ5S0
starts at 11:30 or so
Netflix UI Engineering JS Talks Live Stream
Netflix UI Engineering JS Talks Live Stream
youtube.com
Luke Duncan
@luke__duncan
how do you install this plain javascript package? npm install plain-javascript?? sounds like a great framework
Miguel Palau
@MiguelPalau90
Para que mejores la velocidad
@Alesonline
Goutte-de-pluie
@sylfe
...
Wes John-Alder
@wjohnald
Oh my god.
Paulo Truta
@paulotruta
Now imagine removing all that sh*t from your workflow... :P
Luke Tully
@dansecommander
Shocking.
German Espitia
@espitia7
cc
@levelsio
Reuel Jonathan
@reueljonathan
(No comment)
Shoeb
@shoebmogal
How's it different than SSR?
Ryan Burgess
@burgessdryan
You server side render the React components but don’t load client side React
Sandeep Srinivasa
@sandgorgon1
Is this drop in for vanilla react code ? Sounds like Gatsbyjs except on-the-fly
Andrew WC Brown
@andrewbrown
Just remove it all together for insane speed lol.
Paul McNeely
@McNeely
Imagine what you could do if you got rid of JS altogether. 😜
Vivek Pandey (VP)
@vivekpanday
Indeed Web standards alyzs rocks
michael stearn
@TheMikeStearn
Lol
Darin Hensley
@darin_hensley
Use
@polymer
, it is native JavaScript.... no compiler needed.
EGOIST
@_egoistlily
what about
@sveltejs
😄 it compiles to "plain js"
Alex
@_alexray
Interesting, actually makes sense!
Jignesh Patel
@__jpatel
(No comment)
Programmer Seth 🍗
@S37H
Netflix: Let’s share the landing page stuff, it’s minor yet interesting Twitter: BLARGGGARGGARGARGARGARG
Alexander Solovyov
@asolovyov
That’s a great idea! I’m a little afraid how much work it would take when your landing pages are not as simple. :(
Kevin Oleary
@kolearyUX
Isn’t that basically just python?
Kevin Oleary
@kolearyUX
Seriously though, did you even need the vanilla js? HTML5 and CSS3 now provide as more functionality than js did when it was introduced.
Tony Edwards
@tedwards947
Mostly, no! We had only a few things that had to be rebuilt in plain JS. A few click handlers, and I had to re-roll clientside logging etc
Douglas Gourlay
@dgourlay
Keep the hits coming - thank you!
Jay Phelps
@_jayphelps
Sean@Reactive🇸🇰
@TheLarkInn
🙈🙈🙈🙈
rtorr
@richardiii
Bad title lol
Mark Dalgleish
@markdalgleish
Jay, why do you hate React??
Ormedo
@CodeTerrorist
me lo explicas?? XD
Hakim Mliki
@MlikiHakim
(No comment)
Nessim Btesh
@nesbtesh
how does this actually work? Express server in the back end that only pushes HTML plus another JS file?
Tony Edwards
@tedwards947
Check out my talk:
Netflix UI Engineering JS Talks Live Stream
Netflix UI Engineering JS Talks Live Stream
youtube.com
Vocento engineering
@VocentoEng
So interesting, today we'll be talking about
#reactjs
at Vocento, lets see what UI team have to say about that :D
Moritz Jäger
@user_xy
WOW!:)
Shaun M K Stone
@shaunmstone
Where can I watch this talk please?
Tony Edwards
@tedwards947
youtu.be/V8oTJ8OZ5S0
my talk starts around 11:30
Netflix UI Engineering JS Talks Live Stream
Netflix UI Engineering JS Talks Live Stream
youtube.com
damijan cavar
@cavar_si
Removing JS all together and having static html would improve it even more :)
Cateland
@catelandaxel
ever heard of static webpage ?
Piotr Romanowski
@nullpiotr
Not sure why people are so offended, but seeing some numbers would be cool ¯\_(ツ)_/¯
David Pelayo
@ddpelayo
You could potentially invest in your own JS framework, considering the big impact and needs of your platform
Charlene
@CK1london
performance wise, in what regard, speed ?
Florin Pățan
@dlsniper
Now imagine if you'd remove it from the server as well how much faster it would be :)
Florin Pățan
@dlsniper
I'm happy to help with that removal process :)
Vintila Laurentiu 🦊
@Vantalk
That was expected
Jorge Blanco
@jorgblanc
(No comment)
Noor Khan
@NoorDotKhan
React is pretty bloated, look into
preactjs.com
as an alternative. The idea is saving development time rather than being fast
SOUMYA MUKHOPADHYAY
@budan_m
That's a thing with frameworks ., it's the framework which has the control not the code
Ryan Whitmire
@r_two_n
O.o
{...hafiz}
@hafizalfaza
i came across this cool framework called vanilla.js why don't you give it a shot
Felipe Miziara
@felipemiziara
viu isto aqui ? Não é exatamente o que vc vem criticando?
Marco Gomes
@marcogomes
como assim? eu critico justamente o react, não o abandono dele!
Felipe Miziara
@felipemiziara
Sim, isto mesmo. Te passei para dar mais força à sua crítica.
Marco Gomes
@marcogomes
valeu :) mas minha crítica é mais uma piada. caguei p/ o que os meninos usam p/ fazer app hoje em dia.
Michael Hicks
@Michael_A_Hicks
Great finding. Aside from TTI, what other key user experience metrics do you typically measure and test against?
Tony Edwards
@tedwards947
My team primarily looks at conversion metrics, secondarily CTR and other “user’s flow” metrics
Chanlito
@chanlito_kh
RIP React
Nori Code ⚙
@NoriCode
WHO KNEW adding Mbs of overhead dependencies would cause performance issues!
John Griffiths
@johnantoni
Makes sense. Use it for the parts that need it, but drop it for the client. Simple wins!
(((Arnold Hendrik)))
@Crystallugia
Why not use Haxe ?
@haxelang
Home - Haxe - The Cross-platform Toolkit
Haxe is an open source toolkit based on a modern, high level, strictly typed programming language.
haxe.org
Robin Molnar
@robintel
But the UX is still shite.
Andy Tait
@andyt8
Does this mean anything to you
@spreech
?
Dave Schinkel
@DaveSchinkel
I'm gonna start new.js, that'll fucking take care of it all. This will replace vue, Angular, etc
#programming
#javascript
Anne-Lise
@Temporaneous
Each of these frameworks should provide profile data for a set of common use cases incl. static web page. Easier to choose one then.