SlideShare 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. 

There’s 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. There’s 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! Can’t 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. There’s 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! Can’t 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. 

There’s 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 ❤

More Related Content

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

PDF
How to increase the ui performance of apps designed using react
MoonTechnolabsPvtLtd
 
PPTX
Top 10 Techniques For React Performance Optimization in 2022.pptx
BOSC Tech Labs
 
PPTX
Web Performance & Latest in React
Talentica Software
 
PDF
Top 5 React Performance Optimization Techniques in 2023
ultroNeous Technologies | Best Web App Development Company
 
PDF
a-detailed-guide-everything-you-need-to-know-about-reactjs.pdf
RobertThorson2
 
PDF
Road to Async Nirvana
Boris Litvinsky
 
PPTX
A Deep Dive Into Concurrent React by Matheus Albuquerque
ScyllaDB
 
PDF
Why react matters
ShihChi Huang
 
PDF
Integrating React.js with PHP projects
Ignacio Martín
 
PDF
Boosting Data Fetching in Turkish Apps with React Native and GraphQL
Shiv Technolabs Pvt. Ltd.
 
PDF
React and Web Performance
LarsRttig1
 
PPTX
React and Web Performance
Lars Roettig
 
PPTX
GDSC NITS Presents Kickstart into ReactJS
Pratik Majumdar
 
PDF
Tech Talk on ReactJS
Atlogys Technical Consulting
 
PDF
React js
Rajesh Kolla
 
PPTX
Up and Running with ReactJS
Loc Nguyen
 
PDF
ReactJS Tutorial For Beginners | ReactJS Redux Training For Beginners | React...
Edureka!
 
PPTX
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 
PDF
React Best Practices All Developers Should Follow in 2024.pdf
BOSC Tech Labs
 
PDF
theory-slides-vueh3urh4ur4ur4r44oirj4riu4ri
paridhiagarwal129
 
How to increase the ui performance of apps designed using react
MoonTechnolabsPvtLtd
 
Top 10 Techniques For React Performance Optimization in 2022.pptx
BOSC Tech Labs
 
Web Performance & Latest in React
Talentica Software
 
Top 5 React Performance Optimization Techniques in 2023
ultroNeous Technologies | Best Web App Development Company
 
a-detailed-guide-everything-you-need-to-know-about-reactjs.pdf
RobertThorson2
 
Road to Async Nirvana
Boris Litvinsky
 
A Deep Dive Into Concurrent React by Matheus Albuquerque
ScyllaDB
 
Why react matters
ShihChi Huang
 
Integrating React.js with PHP projects
Ignacio Martín
 
Boosting Data Fetching in Turkish Apps with React Native and GraphQL
Shiv Technolabs Pvt. Ltd.
 
React and Web Performance
LarsRttig1
 
React and Web Performance
Lars Roettig
 
GDSC NITS Presents Kickstart into ReactJS
Pratik Majumdar
 
Tech Talk on ReactJS
Atlogys Technical Consulting
 
React js
Rajesh Kolla
 
Up and Running with ReactJS
Loc Nguyen
 
ReactJS Tutorial For Beginners | ReactJS Redux Training For Beginners | React...
Edureka!
 
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 
React Best Practices All Developers Should Follow in 2024.pdf
BOSC Tech Labs
 
theory-slides-vueh3urh4ur4ur4r44oirj4riu4ri
paridhiagarwal129
 

Recently uploaded (20)

PDF
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
PDF
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
 
PPTX
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
WSO2
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
PDF
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PDF
Draugnet: Anonymous Threat Reporting for a World on Fire
treyka
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
PDF
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
PDF
FME in Overdrive: Unleashing the Power of Parallel Processing
Safe Software
 
PPTX
Practical Applications of AI in Local Government
OnBoard
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
 
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
WSO2
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
Draugnet: Anonymous Threat Reporting for a World on Fire
treyka
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
FME in Overdrive: Unleashing the Power of Parallel Processing
Safe Software
 
Practical Applications of AI in Local Government
OnBoard
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Ad

A journey through a slow react app.