際際滷

際際滷Share a Scribd company logo
A Journey
through a slow
React application
  _
PAVITHRA KODMAD
@PKodmad
ASSUMPTIONS

@PKodmad
ASSUMPTIONS
This is Jira
@PKodmad
issue view
https://www.page1.com/browse/issue-1
My Project My Project/issue-1
Burning task, please complete!
Customer is really pissed about this, find a way to fix this. 
Theres really no legit way to reproduce this yet, but you gotta
try more.
ASSIGNEE
PK
LAUNCH DATE
29/02/2019
ESTIMATE
200
BOARD
BACKLOG
ISSUES
REPORTS
ASSUMPTIONS
@PKodmad
Backlog
https://www.page1.com/projectkey/backlog
My Project
BOARD
BACKLOG
ISSUES
REPORTS
BACKLOG
ISSUE 1 - Fix this first
ISSUE 2 - Fix this next
ISSUE 3 - Fix this later
ISSUE 4 - Fix this never
ASSUMPTIONS
@PKodmad
Board
https://www.page1.com/projectkey/board
My Project
BOARD
BACKLOG
ISSUES
REPORTS
BOARD
TO DO
Fix this never
Issue - 4
Fix this if possible
Issue - 3
WIP
Fix this next
Issue - 2
DONE
Fix this first
Issue - 1
ASSUMPTIONS
@PKodmad
ASSUMPTIONS
Client Side Rendering = React.render()
issue view
https://www.page1.com/browse/issue-1
My Project My Project/issue-1
Burning task, please complete!
Customer is really pissed about this, find a way to fix
this. Theres really no legit way to reproduce this yet,
but you gotta try more.
ASSIGNEE
PK
LAUNCH DATE
29/02/2019
ESTIMATE
200
BOARD
BACKLOG
ISSUES
REPORTS
Fix fast! Cant wait
COMMENTS
@PKodmad
ASSUMPTIONS
Server Side Rendering = React.renderToString()
issue view
https://www.page1.com/browse/issue-1
My Project My Project/issue-1
Burning task, please complete!
Customer is really pissed about this, find a way to fix
this. Theres really no legit way to reproduce this yet,
but you gotta try more.
ASSIGNEE
PK
LAUNCH DATE
29/02/2019
ESTIMATE
200
BOARD
BACKLOG
ISSUES
REPORTS
Fix fast! Cant wait
COMMENTS
@PKodmad
ASSUMPTIONS
SPA - Single Page Application
@PKodmad
ASSUMPTIONS
TTR - Time to render
TTI - Time to Interactive
@PKodmad
REACT PERFORMANCE
@PKodmad
Do you really have a problem with
performance though?
@PKodmad
IN THREE ACTS
@PKodmad
The data fetching duality
ACT 1
@PKodmad
@PKodmad
DATA IN SSR
data = fetch()
store = createStore()
state = store.getState()
window.SSR_DATA = state
@PKodmad
DATA IN SPA
initialState = window.SSR_DATA
store = createStore(initialState)
@PKodmad
Router
@PKodmad
<Router>
{children}
<Router/>
<PrefetchCacheProvider>
<PrefetchCacheProvider/>
Powered by react context
@PKodmad
{ (data, loading) =>
<PartofApp data={data} />
}
<PrefetchQuery resolve={}>
<PrefetchQuery/>
Only to be used in 
case of SSR
@PKodmad
Route?
@PKodmad
Double rendering strategy
 for reuse
 for performance
@PKodmad
treewalk +TTR = fetch + render
@PKodmad
treewalk +TTR = fetch + render
@PKodmad
Thanks react-router docs.
@PKodmad
@PKodmad
<SuspenseForSSR />
PREFERRED
SOLUTION
The loading page congruence
ACT 2
@PKodmad
@PKodmad
SSR HTML = Client HTML
1. Analytics HOC
2. Logging Infra
3. In product help
@PKodmad
React.hydrate(<App />)
@PKodmad
issue view
https://www.page1.com/browse/issue-1
My Project My Project/issue-1
Burning task, please complete!
Customer is really pissed about this, find a way to fix this. 
Theres really no legit way to reproduce this yet, but you gotta
try more.
ASSIGNEE
PK
LAUNCH DATE
29/02/2019
ESTIMATE
200
BOARD
BACKLOG
ISSUES
REPORTS
If you intentionally need to render
something different on the server and
the client, you can do a two-pass
rendering.
@PKodmad
Double render?
https://reactjs.org/docs/react-dom.html#hydrate
@PKodmad
const html = saveSSRHTML()
React.render(<App />)
if (loading) { }if (loading) { <div dangerouslySetInnerHTML={html} /> }
@PKodmad
PREFERRED
SOLUTION
し
The state management formulation
ACT 3
@PKodmad
@PKodmad
@PKodmad
https://github.com/facebook/react/issues/13739
@PKodmad
https://github.com/reduxjs/react-redux/issues/1177
@PKodmad
https://github.com/facebook/react/issues/14110
@PKodmad
react-sweet-state
@albertogasparin
https://github.com/atlassian/react-sweet-state/blob/
b155c6b6eab13df306d6413dee343b0bd8d99846/src/context.js
@PKodmad
Scaling perf issues
Lack of selectors
Debugging workflow
Provider hell
@PKodmad
@PKodmad
PREFERRED
SOLUTION
Honorable mentions
 React.memo()
 Lighter SSR components
 Page Ready indicator
@PKodmad
Thanks for the dev tools
@PKodmad
@PKodmad
All good things happen just outside of your comfort zone
@PKodmad
If you send some props
Its so lovely..
If you set the state
Its okay..
If you send some props
Its so lovely..
If you set the state
Its okay..
@PKodmad
You sync the DOM
By next tick tick tick
By next tick tick tick
Reeeact.. 
@PKodmad
Million providers with no owners
Million memoized functions I write
Million components I create
Million renders squeeze my thread
Time for some hooks..
Tick tick tick
@PKodmad
@PKodmad
Thank you for all the
Ad

Recommended

AMPifying your Drupal 8 Site : higher performance and higher engagement - Par...
AMPifying your Drupal 8 Site : higher performance and higher engagement - Par...
DrupalMumbai
Accelerated Mobile Pages (AMP) & How it will Impact your Business
Accelerated Mobile Pages (AMP) & How it will Impact your Business
Harshavardhan MP
AMP up Your WordPress Site
AMP up Your WordPress Site
Prem Tiwari
Get AMP'ed for Accelerated Mobile Pages - SEO Grail Philadelphia 1/20/16
Get AMP'ed for Accelerated Mobile Pages - SEO Grail Philadelphia 1/20/16
Sean Malseed
AMP with WordPress by Pradeep Sonawane @ Google AMP Roadshow Mumbai 2018
AMP with WordPress by Pradeep Sonawane @ Google AMP Roadshow Mumbai 2018
rtCamp
ApacheCon 2017: What's new in httpd 2.4
ApacheCon 2017: What's new in httpd 2.4
Jim Jagielski
A Practical Approach to React Native at All Things Open Conference
A Practical Approach to React Native at All Things Open Conference
Tracy Lee
React Native - Getting Started
React Native - Getting Started
Tracy Lee
20 Ideas On How To Improve Your Agile Board
20 Ideas On How To Improve Your Agile Board
Marcus Hammarberg
BDD in practice based on an open source project
BDD in practice based on an open source project
ukasz Chruciel
Not your daddy's web server
Not your daddy's web server
Jim Jagielski
Open Day July 2019
Open Day July 2019
Frappe Technologies Pvt. Ltd.
Automating the real-user scenarios across multi-apps, and multi-devices
Automating the real-user scenarios across multi-apps, and multi-devices
Anand Bagmar
JS Fest 2019. Minko Gechev. Building Fast Angular Applications by Default
JS Fest 2019. Minko Gechev. Building Fast Angular Applications by Default
JSFestUA
Frappe Open Day - September 2018
Frappe Open Day - September 2018
Frappe Technologies Pvt. Ltd.
Apache httpd 2.4 overview
Apache httpd 2.4 overview
Jim Jagielski
Web Performance Madness - brightonSEO 2018
Web Performance Madness - brightonSEO 2018
Bastian Grimm
How To Win a Hackaton - My thoughts on the WebGeek Devcup
How To Win a Hackaton - My thoughts on the WebGeek Devcup
Nikko Bautista
PGday_korea_2021_leeuijin
PGday_korea_2021_leeuijin
Grygoriy gavaleshko cross-framework communication on frontent
Grygoriy gavaleshko cross-framework communication on frontent
Aneta Koosowska (Winiewska)
How to improve gradle build speed
How to improve gradle build speed
Fate Chang
Apache httpd Reverse Proxy and Tomcat
Apache httpd Reverse Proxy and Tomcat
Jim Jagielski
Testing with Codeception
Testing with Codeception
Jeremy Coates
10 tips for Redux at scale
10 tips for Redux at scale
inovia
Redux at scale
Redux at scale
inovia
Extending Gradle
Extending Gradle
Rene Gr旦schke
Production optimization with React and Webpack
Production optimization with React and Webpack
k88hudson
Aura LA GDG - July 17-2017
Aura LA GDG - July 17-2017
Kristan Uccello
Python Conference Singapore - 19 Jun 2025
Python Conference Singapore - 19 Jun 2025
ninefyi
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software

More Related Content

Similar to A journey through a slow react app. (20)

20 Ideas On How To Improve Your Agile Board
20 Ideas On How To Improve Your Agile Board
Marcus Hammarberg
BDD in practice based on an open source project
BDD in practice based on an open source project
ukasz Chruciel
Not your daddy's web server
Not your daddy's web server
Jim Jagielski
Open Day July 2019
Open Day July 2019
Frappe Technologies Pvt. Ltd.
Automating the real-user scenarios across multi-apps, and multi-devices
Automating the real-user scenarios across multi-apps, and multi-devices
Anand Bagmar
JS Fest 2019. Minko Gechev. Building Fast Angular Applications by Default
JS Fest 2019. Minko Gechev. Building Fast Angular Applications by Default
JSFestUA
Frappe Open Day - September 2018
Frappe Open Day - September 2018
Frappe Technologies Pvt. Ltd.
Apache httpd 2.4 overview
Apache httpd 2.4 overview
Jim Jagielski
Web Performance Madness - brightonSEO 2018
Web Performance Madness - brightonSEO 2018
Bastian Grimm
How To Win a Hackaton - My thoughts on the WebGeek Devcup
How To Win a Hackaton - My thoughts on the WebGeek Devcup
Nikko Bautista
PGday_korea_2021_leeuijin
PGday_korea_2021_leeuijin
Grygoriy gavaleshko cross-framework communication on frontent
Grygoriy gavaleshko cross-framework communication on frontent
Aneta Koosowska (Winiewska)
How to improve gradle build speed
How to improve gradle build speed
Fate Chang
Apache httpd Reverse Proxy and Tomcat
Apache httpd Reverse Proxy and Tomcat
Jim Jagielski
Testing with Codeception
Testing with Codeception
Jeremy Coates
10 tips for Redux at scale
10 tips for Redux at scale
inovia
Redux at scale
Redux at scale
inovia
Extending Gradle
Extending Gradle
Rene Gr旦schke
Production optimization with React and Webpack
Production optimization with React and Webpack
k88hudson
Aura LA GDG - July 17-2017
Aura LA GDG - July 17-2017
Kristan Uccello
20 Ideas On How To Improve Your Agile Board
20 Ideas On How To Improve Your Agile Board
Marcus Hammarberg
BDD in practice based on an open source project
BDD in practice based on an open source project
ukasz Chruciel
Not your daddy's web server
Not your daddy's web server
Jim Jagielski
Automating the real-user scenarios across multi-apps, and multi-devices
Automating the real-user scenarios across multi-apps, and multi-devices
Anand Bagmar
JS Fest 2019. Minko Gechev. Building Fast Angular Applications by Default
JS Fest 2019. Minko Gechev. Building Fast Angular Applications by Default
JSFestUA
Apache httpd 2.4 overview
Apache httpd 2.4 overview
Jim Jagielski
Web Performance Madness - brightonSEO 2018
Web Performance Madness - brightonSEO 2018
Bastian Grimm
How To Win a Hackaton - My thoughts on the WebGeek Devcup
How To Win a Hackaton - My thoughts on the WebGeek Devcup
Nikko Bautista
PGday_korea_2021_leeuijin
PGday_korea_2021_leeuijin
Grygoriy gavaleshko cross-framework communication on frontent
Grygoriy gavaleshko cross-framework communication on frontent
Aneta Koosowska (Winiewska)
How to improve gradle build speed
How to improve gradle build speed
Fate Chang
Apache httpd Reverse Proxy and Tomcat
Apache httpd Reverse Proxy and Tomcat
Jim Jagielski
Testing with Codeception
Testing with Codeception
Jeremy Coates
10 tips for Redux at scale
10 tips for Redux at scale
inovia
Redux at scale
Redux at scale
inovia
Production optimization with React and Webpack
Production optimization with React and Webpack
k88hudson
Aura LA GDG - July 17-2017
Aura LA GDG - July 17-2017
Kristan Uccello

Recently uploaded (20)

Python Conference Singapore - 19 Jun 2025
Python Conference Singapore - 19 Jun 2025
ninefyi
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Impelsys Inc.
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
Turning the Page How AI is Exponentially Increasing Speed, Accuracy, and Ef...
Turning the Page How AI is Exponentially Increasing Speed, Accuracy, and Ef...
Impelsys Inc.
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
Improving Data Integrity: Synchronization between EAM and ArcGIS Utility Netw...
Improving Data Integrity: Synchronization between EAM and ArcGIS Utility Netw...
Safe Software
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
Edge AI and Vision Alliance
June Patch Tuesday
June Patch Tuesday
Ivanti
Python Conference Singapore - 19 Jun 2025
Python Conference Singapore - 19 Jun 2025
ninefyi
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Impelsys Inc.
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
Turning the Page How AI is Exponentially Increasing Speed, Accuracy, and Ef...
Turning the Page How AI is Exponentially Increasing Speed, Accuracy, and Ef...
Impelsys Inc.
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
Improving Data Integrity: Synchronization between EAM and ArcGIS Utility Netw...
Improving Data Integrity: Synchronization between EAM and ArcGIS Utility Netw...
Safe Software
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
Edge AI and Vision Alliance
June Patch Tuesday
June Patch Tuesday
Ivanti
Ad

A journey through a slow react app.