SlideShare a Scribd company logo
react server side rendering
react boston february 2015
@nickdreckshage
isomorphic is a pretty sexy word…
• …for shared code. spectrum: templates -> meteor.
• got into it with rendr / spikes talk (http://bit.ly/1MoAzjZ)
• experimented making ‘isomorphic’ on npm
• frontend trend / direction (backbone, react, ember)
• word not cool anymore? oh well (http://bit.ly/1CxzIFy)
react made it extremely easy
http://bit.ly/1yzOaul
• node as a ui layer (http://bit.ly/1bjOXb3)
• not too many abstractions (webpack, superagent, etc)
• careful with context (http://bit.ly/1EewJEn)
• react router; react nexus
• relay / graphql
workflow
• 1 lookup; 1 event binding; 0 repaints
• base10 numbering; adler32 checksum
• high level (virtual dom; synthetic events)
• low level (jquery killer bees)
• larger html payload. html + json data + async js
smart server side rendering
sounds perfect…
• not great!
• simple experiment (http://bitly.com/1yzOaum); 1mb json; 1000
items; a few components / partials.
• ab -c 1 -n 100; mean response time on slow macbook air
server side performance
react (node) react* (node) hogan (node) mustache (go)
1250ms 650ms 450ms 30ms
*using best practices
• http://bit.ly/1DxGdfx
• “funny story about server rendering - it wasn’t actually designed
that way” (Sebastian Markbåge)
• “we don’t use it that heavily, which is why we haven’t really
invested strong in it” (Sebastian Markbåge)
• improvements: autobinding, ignoring state
q&a @ react conf
• primary concerns: architecture + performance
• server side rendering a bonus (with great architecture)
• facebook doesn’t use server side rendering in prod (tmk)
• instagram did, then abandoned it (http://bit.ly/1FPekyY)
• transparency > collective ignorance
a secondary concern
• netflix switching all platforms to react
• facebook mobile (server rendered; relay / graphql)
• e-commerce? non-single page apps?
• bbc mobile (http://bit.ly/1Ab0uoD)
• flipboard (http://bit.ly/1zTrFnK)
• ssr performance as final barrier. then no downside?
growing importance
• use node. not ruby racer / php v8js
• compile jsx / webpack for server?*
• NODE_ENV=production*
• require(‘wrapped-react’)*
• cluster.fork()
• cache (um…)
best practices
*http://bit.ly/1AF4yiP
easy 1250ms
+ compile jsx 1240ms*
+ NODE_ENV 990ms
+ wrapped 650ms
+ cluster **
+ cache 30ms!
* increases with # of components
** basic load balancing
• node limitations, value in portability
• jsxtache (dont use) (http://bit.ly/1Modxtm)
• compile to js? clojure? hhvm/hack?
crazy ideas
• preview templates
• optimistic updates
• first paint?
perceived performance
lets stop using the phrase perceived performance
when talking about server side rendering
…so should i still use it? yes.
react is awesome.

More Related Content

PDF
Isomorphic React Applications: Performance And Scalability
PDF
Client Vs. Server Rendering
PDF
Performance and Scalability Art of Isomorphic React Applications
PDF
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
PDF
Isomorphic web application
PDF
Server and client rendering of single page apps
PDF
Angular 2 vs React
PDF
Grokking #9: Building a real-time and offline editing service with Couchbase
Isomorphic React Applications: Performance And Scalability
Client Vs. Server Rendering
Performance and Scalability Art of Isomorphic React Applications
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
Isomorphic web application
Server and client rendering of single page apps
Angular 2 vs React
Grokking #9: Building a real-time and offline editing service with Couchbase

What's hot (20)

PDF
The Dark Side of Single Page Applications
PDF
Modern javascript
PDF
React.js and Flux in details
PDF
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
PDF
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
PPTX
How NOT to get lost in the current JavaScript landscape
PDF
Mean Stack - An Overview
PDF
MEAN Stack WeNode Barcelona Workshop
PDF
BP101: A Modernized Workflow w/ Domino/XPages
PPTX
Testing your Single Page Application
PDF
Beginning MEAN Stack
PDF
Why You Should Use MERN Stack for Startup Apps?
PPTX
MEAN Stack
PDF
Pump up the JAM with Gatsby
PDF
The MEAN Stack
PDF
React.js for Back-End developers
PDF
A 20 minute introduction to AngularJS for XPage developers
PDF
Node, express & sails
PPTX
Introduction to MERN Stack
PPTX
JavaScript innovaties: ECMAScript 6 & 7
The Dark Side of Single Page Applications
Modern javascript
React.js and Flux in details
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
How NOT to get lost in the current JavaScript landscape
Mean Stack - An Overview
MEAN Stack WeNode Barcelona Workshop
BP101: A Modernized Workflow w/ Domino/XPages
Testing your Single Page Application
Beginning MEAN Stack
Why You Should Use MERN Stack for Startup Apps?
MEAN Stack
Pump up the JAM with Gatsby
The MEAN Stack
React.js for Back-End developers
A 20 minute introduction to AngularJS for XPage developers
Node, express & sails
Introduction to MERN Stack
JavaScript innovaties: ECMAScript 6 & 7
Ad

Viewers also liked (12)

PPTX
Com_21
PDF
Integrating React.js Into a PHP Application
PDF
You Got React.js in My PHP
PPTX
Изоморфные React-приложения производительность и масштабирование / Денис Изма...
PDF
Progressive Web Apps by Millicent Convento
PDF
rx.js make async programming simpler
PPTX
PHP and node.js Together
PDF
Integrating Node.js with PHP
PDF
"Изоморфная разработка на javascript с помощью react.js" Максим Климишин
PDF
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
PDF
Better PHP-Frontend Integration with Tungsten.js
PPTX
Isomorphic web apps with react
Com_21
Integrating React.js Into a PHP Application
You Got React.js in My PHP
Изоморфные React-приложения производительность и масштабирование / Денис Изма...
Progressive Web Apps by Millicent Convento
rx.js make async programming simpler
PHP and node.js Together
Integrating Node.js with PHP
"Изоморфная разработка на javascript с помощью react.js" Максим Климишин
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
Better PHP-Frontend Integration with Tungsten.js
Isomorphic web apps with react
Ad

Similar to React server side rendering performance (20)

PDF
What is Server-side Rendering? How to Render Your React App on the Server-sid...
PDF
Breaking the Server-Client Divide with Node.js and React
PPTX
Client vs Server Components in Next.js.pptx
PDF
React Server Component in Next.js by Hanief Utama
PDF
Server rendering-talk
PPTX
Isomorphic JavaScript – future of the web
PPTX
ReactJs Optimizations , Making server side react faster
PDF
Revolutionizing Web Development with React Server Components: A Comprehensive...
PDF
FRONTEND DEVELOPMENT WITH REACT.JS
PDF
Integrating React.js Into a PHP Application: Dutch PHP 2019
PPTX
Building isomorphic java script apps faster with next.js
PDF
Server-side React with Headless CMS – Exove
PPTX
Web summit.pptx
PDF
Mastering React Server Components and Server Actions in React 19
PPTX
Progressive Web Apps and React
PDF
Server Side React for WordPress by Muhammad Muhsin @ The JavaScript for WordP...
PPTX
React js
PPTX
How to make React Applications SEO-friendly
PPTX
Full Stack_Reac web Development and Application
PDF
React in Action ( PDFDrive ).pdf
What is Server-side Rendering? How to Render Your React App on the Server-sid...
Breaking the Server-Client Divide with Node.js and React
Client vs Server Components in Next.js.pptx
React Server Component in Next.js by Hanief Utama
Server rendering-talk
Isomorphic JavaScript – future of the web
ReactJs Optimizations , Making server side react faster
Revolutionizing Web Development with React Server Components: A Comprehensive...
FRONTEND DEVELOPMENT WITH REACT.JS
Integrating React.js Into a PHP Application: Dutch PHP 2019
Building isomorphic java script apps faster with next.js
Server-side React with Headless CMS – Exove
Web summit.pptx
Mastering React Server Components and Server Actions in React 19
Progressive Web Apps and React
Server Side React for WordPress by Muhammad Muhsin @ The JavaScript for WordP...
React js
How to make React Applications SEO-friendly
Full Stack_Reac web Development and Application
React in Action ( PDFDrive ).pdf

Recently uploaded (20)

PPTX
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPT
Project quality management in manufacturing
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Construction Project Organization Group 2.pptx
PPTX
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
composite construction of structures.pdf
PPTX
web development for engineering and engineering
PPT
Mechanical Engineering MATERIALS Selection
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
Geodesy 1.pptx...............................................
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Digital Logic Computer Design lecture notes
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
Structs to JSON How Go Powers REST APIs.pdf
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Project quality management in manufacturing
Lecture Notes Electrical Wiring System Components
Construction Project Organization Group 2.pptx
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Operating System & Kernel Study Guide-1 - converted.pdf
composite construction of structures.pdf
web development for engineering and engineering
Mechanical Engineering MATERIALS Selection
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Geodesy 1.pptx...............................................
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Lesson 3_Tessellation.pptx finite Mathematics
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Digital Logic Computer Design lecture notes
bas. eng. economics group 4 presentation 1.pptx
Structs to JSON How Go Powers REST APIs.pdf

React server side rendering performance

  • 1. react server side rendering react boston february 2015 @nickdreckshage
  • 2. isomorphic is a pretty sexy word… • …for shared code. spectrum: templates -> meteor. • got into it with rendr / spikes talk (http://bit.ly/1MoAzjZ) • experimented making ‘isomorphic’ on npm • frontend trend / direction (backbone, react, ember) • word not cool anymore? oh well (http://bit.ly/1CxzIFy)
  • 3. react made it extremely easy http://bit.ly/1yzOaul
  • 4. • node as a ui layer (http://bit.ly/1bjOXb3) • not too many abstractions (webpack, superagent, etc) • careful with context (http://bit.ly/1EewJEn) • react router; react nexus • relay / graphql workflow
  • 5. • 1 lookup; 1 event binding; 0 repaints • base10 numbering; adler32 checksum • high level (virtual dom; synthetic events) • low level (jquery killer bees) • larger html payload. html + json data + async js smart server side rendering
  • 7. • not great! • simple experiment (http://bitly.com/1yzOaum); 1mb json; 1000 items; a few components / partials. • ab -c 1 -n 100; mean response time on slow macbook air server side performance react (node) react* (node) hogan (node) mustache (go) 1250ms 650ms 450ms 30ms *using best practices
  • 8. • http://bit.ly/1DxGdfx • “funny story about server rendering - it wasn’t actually designed that way” (Sebastian Markbåge) • “we don’t use it that heavily, which is why we haven’t really invested strong in it” (Sebastian Markbåge) • improvements: autobinding, ignoring state q&a @ react conf
  • 9. • primary concerns: architecture + performance • server side rendering a bonus (with great architecture) • facebook doesn’t use server side rendering in prod (tmk) • instagram did, then abandoned it (http://bit.ly/1FPekyY) • transparency > collective ignorance a secondary concern
  • 10. • netflix switching all platforms to react • facebook mobile (server rendered; relay / graphql) • e-commerce? non-single page apps? • bbc mobile (http://bit.ly/1Ab0uoD) • flipboard (http://bit.ly/1zTrFnK) • ssr performance as final barrier. then no downside? growing importance
  • 11. • use node. not ruby racer / php v8js • compile jsx / webpack for server?* • NODE_ENV=production* • require(‘wrapped-react’)* • cluster.fork() • cache (um…) best practices *http://bit.ly/1AF4yiP easy 1250ms + compile jsx 1240ms* + NODE_ENV 990ms + wrapped 650ms + cluster ** + cache 30ms! * increases with # of components ** basic load balancing
  • 12. • node limitations, value in portability • jsxtache (dont use) (http://bit.ly/1Modxtm) • compile to js? clojure? hhvm/hack? crazy ideas
  • 13. • preview templates • optimistic updates • first paint? perceived performance
  • 14. lets stop using the phrase perceived performance when talking about server side rendering
  • 15. …so should i still use it? yes. react is awesome.