SlideShare a Scribd company logo
Web Apps performance &
JavaScript compilers
Roman Liutikov
Attendify
Web Apps
nowadays
5 MB of awesome web
technologies is
loading...
Роман Лютиков "Web Apps Performance & JavaScript Compilers"
Роман Лютиков "Web Apps Performance & JavaScript Compilers"
This is NOT good
● Makes people wait
● Eats their traffic and money
● Everyone hates you
● You loose money
WTMHLM
performance
anti-pattern
the goal is to
Reduce
Time To Interaction
The right way _______
index.html
route-1.js
common-1.js
I can see it I can use it
route-2.js Pre-caching
ServerRendering
(JS&CSS)
Code Splitting
Code splitting
Divide JS bundle into chunks
route-1.js route-2.js route-3.js route-4.js
...
common-1.js common-2.js
Webpack
CommonsChunkPlugin
Initial load
Load initial route and its common chunk
route-1.js
common-1.js
The compiler is to blame
for everything
Smarter compiler
means smaller
output size & eval time
Compiler
optimizations
Dead code elimination
Remove code that can never be executed
const dec = (x) => x - 1;
const inc = (x) => x + 1;
const x = 0;
const y = 1;
inc(x);
inc
decy
x
UglifyJS
Rollup
Babili
Closure Compiler
Dependency graph
Tree-shaking (A special case of DCE)
Do not include unused exports
// math.js
export const dec = (x) => x - 1;
export const inc = (x) => x + 1;
// main.js
import { inc } from 'math';
const x = 0;
const y = 1;
inc(x);
Webpack 2
Rollup
Closure Compiler
Function call inlining
Replace a function call with its body
const person = {
fname: 'John',
lname: 'Doe'
};
function fullName(p) {
return p.fname + ' ' + p.lname;
}
console.log(fullName(person));
Closure Compiler
const person = {
fname: 'John',
lname: 'Doe'
};
console.log(
person.fname + ' ' +
person.lname);
Property flattening (collapsing)
Collapse object properties into separate variables
const person = {
fname: 'John',
lname: 'Doe'
};
console.log(
person.fname + ' ' +
person.lname);
Closure Compiler
const person$fname = 'John';
const person$lname = 'Doe';
console.log(
person$fname + ' ' +
person$lname);
Constant folding
Evaluate constant expressions at compile time
UglifyJS
Babili
Closure Compiler
const person$fname = 'John';
const person$lname = 'Doe';
console.log('John Doe');
const person$fname = 'John';
const person$lname = 'Doe';
console.log(
person$fname + ' ' +
person$lname);
Known methods folding
Evaluate known methods at compile time
Closure Compiler
'012345'
'World!'
99
[0, 1, 2, 3, 4, 5].join('');
'Hello, world!'.substr(7, 11);
parseInt('99 UAH');
Code splitting in Webpack
Module level splitting
a b c d a b c
a b
a c
input output
Code splitting in Closure Compiler
Function/method & variable level splitting
a b c d a
a b
a c
input outputb
c
Precache & Lazy load
Precache
route-1.js
common-1.js
Load and/or cache chunks in background
UI is ready
Load in bg
Lazy load
route-1.js
common-1.js
Load chunks on demand
Navigation
Load chunkroute-2.js
...
Code splitting & Lazy loading
in Webpack 2
Per route chunks with React Router
<Route
path="user/:id"
getComponent={(loc, cb) => {
System.import("pages/User")
.then((module) => cb(null, module));
}}>
Preload chunks
* Chrome, Opera & Chrome for Android
<head>
<link rel="preload" as="script" href="chunk-1.js">
<link rel="preload" as="script" href="chunk-2.js">
...
</head>
Precache with Service Worker (sw-precache)
Preload + Offline support
plugins: [
new SWPrecacheWebpackPlugin({
cacheId: "app",
filename: "app-sw.js",
staticFileGlobs: [
"app/js/**.js"
]
})]
What about
framework size?
Ahead-of-time compilation
Reduce runtime overhead
Templates AOT compilation in
Angular 2 & Vue.js 2
Роман Лютиков "Web Apps Performance & JavaScript Compilers"
Preact Vue.js Riot.js
Lightweight alternatives
Out of the box code splitting is
coming to
Should I use
code splitting? Yes
Should I use
server-side
rendering?
Maybe
Should I care
about compiler? NO
@roman01la
Thank You!

More Related Content

What's hot (20)

PPTX
Test-Driven JavaScript Development (JavaZone 2010)
Christian Johansen
 
PDF
Asynchronous Module Definition (AMD)
xMartin12
 
PDF
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
Fwdays
 
PDF
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
Fwdays
 
PDF
JavaScript + Jenkins = Winning!
Eric Wendelin
 
PPTX
Code ceptioninstallation
Andrii Lagovskiy
 
PDF
Continuous Integration for front-end JavaScript
Lars Thorup
 
PDF
Use Node.js to create a REST API
Fabien Vauchelles
 
PDF
Testing Web Applications
Seth McLaughlin
 
PDF
Григорий Шехет "Treasure hunt in the land of Reactive frameworks"
Fwdays
 
PDF
Detecting headless browsers
Sergey Shekyan
 
PDF
Node ppt
Tamil Selvan R S
 
PDF
System webpack-jspm
Jesse Warden
 
PDF
Writing Software not Code with Cucumber
Ben Mabey
 
PPTX
CasperJS
LearningTech
 
PPTX
A few good JavaScript development tools
Simon Kim
 
PPTX
Nightwatch JS for End to End Tests
Sriram Angajala
 
PPTX
Introduction to Node.js
Vikash Singh
 
PDF
[CLIW] Web testing
Bogdan Gaza
 
PDF
GlobalLogic Test Automation Online TechTalk “Playwright — A New Hope”
GlobalLogic Ukraine
 
Test-Driven JavaScript Development (JavaZone 2010)
Christian Johansen
 
Asynchronous Module Definition (AMD)
xMartin12
 
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
Fwdays
 
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
Fwdays
 
JavaScript + Jenkins = Winning!
Eric Wendelin
 
Code ceptioninstallation
Andrii Lagovskiy
 
Continuous Integration for front-end JavaScript
Lars Thorup
 
Use Node.js to create a REST API
Fabien Vauchelles
 
Testing Web Applications
Seth McLaughlin
 
Григорий Шехет "Treasure hunt in the land of Reactive frameworks"
Fwdays
 
Detecting headless browsers
Sergey Shekyan
 
System webpack-jspm
Jesse Warden
 
Writing Software not Code with Cucumber
Ben Mabey
 
CasperJS
LearningTech
 
A few good JavaScript development tools
Simon Kim
 
Nightwatch JS for End to End Tests
Sriram Angajala
 
Introduction to Node.js
Vikash Singh
 
[CLIW] Web testing
Bogdan Gaza
 
GlobalLogic Test Automation Online TechTalk “Playwright — A New Hope”
GlobalLogic Ukraine
 

Viewers also liked (20)

PPTX
Денис Резник "Relational Database Design. Normalize till it hurts, then Denor...
Fwdays
 
PPTX
Илья Климов "О драконах ни слова"
Fwdays
 
PPTX
Сергей Калинец "Не SQL-ом единым..."
Fwdays
 
PPTX
All roads lead to rome
Stasys Baubkus
 
PPT
All Roads Lead to Rome...
JimmyJackson182
 
PDF
MS Patient Summit 2015, Rome: General Slides
SPEM - Sociedade Portuguesa de Esclerose Múltipla
 
PPTX
Roman architectonic elements
happyhospital
 
PPT
18. roman life #2
drfishpp
 
PPTX
Roman City dig, session 9, 2012: Nutrition in the Ancient World, by Kristin D...
Ecomuseum Cavalleria
 
PPTX
Roman Civilization
Mercy Junfandi
 
PPT
Roman cities
escolaribatallada
 
PPT
The romans in Britain
lmtornero
 
PPTX
National pensions institute
Nidhi Thigale
 
PPTX
Unit 02E - Roman Architecture and Town Planning
Charlotte Jaram
 
PPTX
Romen dwellings
Nidhi Thigale
 
PPS
A roman city
pedrote22
 
PDF
Symfony Guard Authentication: Fun with API Token, Social Login, JWT and more
Ryan Weaver
 
PPTX
9. F2011 Cities of Roman Britain
Robert Ehrlich
 
PPS
A Buried Roman City, Pompeii
Makala D.
 
PDF
"Посмотрим на Акку-Джаву" Дмитрий Мантула
Fwdays
 
Денис Резник "Relational Database Design. Normalize till it hurts, then Denor...
Fwdays
 
Илья Климов "О драконах ни слова"
Fwdays
 
Сергей Калинец "Не SQL-ом единым..."
Fwdays
 
All roads lead to rome
Stasys Baubkus
 
All Roads Lead to Rome...
JimmyJackson182
 
MS Patient Summit 2015, Rome: General Slides
SPEM - Sociedade Portuguesa de Esclerose Múltipla
 
Roman architectonic elements
happyhospital
 
18. roman life #2
drfishpp
 
Roman City dig, session 9, 2012: Nutrition in the Ancient World, by Kristin D...
Ecomuseum Cavalleria
 
Roman Civilization
Mercy Junfandi
 
Roman cities
escolaribatallada
 
The romans in Britain
lmtornero
 
National pensions institute
Nidhi Thigale
 
Unit 02E - Roman Architecture and Town Planning
Charlotte Jaram
 
Romen dwellings
Nidhi Thigale
 
A roman city
pedrote22
 
Symfony Guard Authentication: Fun with API Token, Social Login, JWT and more
Ryan Weaver
 
9. F2011 Cities of Roman Britain
Robert Ehrlich
 
A Buried Roman City, Pompeii
Makala D.
 
"Посмотрим на Акку-Джаву" Дмитрий Мантула
Fwdays
 
Ad

Similar to Роман Лютиков "Web Apps Performance & JavaScript Compilers" (20)

PPTX
Cut it up
FITC
 
PPTX
Google closure compiler
Prasad Kancharla
 
PPTX
Browser Internals for JS Devs: WebU Toronto 2016 by Alex Blom
Alex Blom
 
PDF
JS Module Server
Szabolcs Szabolcsi-Tóth
 
PPTX
JavaScript front end performance optimizations
Chris Love
 
PDF
JS Fest 2019. Minko Gechev. Building Fast Angular Applications by Default
JSFestUA
 
PPTX
Webpack essentails - feb 19, 2020
Jesse Colligan
 
PPTX
Future-proof Development for Classic SharePoint
Bob German
 
PDF
Performance Optimization and JavaScript Best Practices
Doris Chen
 
KEY
JavaScript Growing Up
David Padbury
 
PDF
Progressive transpilation and the road to ES2015 in production
Jacques Favreau
 
PDF
From Hacker to Programmer (w/ Webpack, Babel and React)
Joseph Chiang
 
PDF
Ten useful JavaScript tips & best practices
Ankit Rastogi
 
PDF
Front end-modernization
ColdFusionConference
 
PDF
Front end-modernization
devObjective
 
PDF
Front-End Modernization for Mortals
cgack
 
PDF
Javascript Performance
olivvv
 
PDF
Intro to React
Troy Miles
 
PPTX
Stanislav Khorunzhyi, "Front-end it like a PRO"
Sigma Software
 
PDF
ES6 Simplified
Carlos Ble
 
Cut it up
FITC
 
Google closure compiler
Prasad Kancharla
 
Browser Internals for JS Devs: WebU Toronto 2016 by Alex Blom
Alex Blom
 
JS Module Server
Szabolcs Szabolcsi-Tóth
 
JavaScript front end performance optimizations
Chris Love
 
JS Fest 2019. Minko Gechev. Building Fast Angular Applications by Default
JSFestUA
 
Webpack essentails - feb 19, 2020
Jesse Colligan
 
Future-proof Development for Classic SharePoint
Bob German
 
Performance Optimization and JavaScript Best Practices
Doris Chen
 
JavaScript Growing Up
David Padbury
 
Progressive transpilation and the road to ES2015 in production
Jacques Favreau
 
From Hacker to Programmer (w/ Webpack, Babel and React)
Joseph Chiang
 
Ten useful JavaScript tips & best practices
Ankit Rastogi
 
Front end-modernization
ColdFusionConference
 
Front end-modernization
devObjective
 
Front-End Modernization for Mortals
cgack
 
Javascript Performance
olivvv
 
Intro to React
Troy Miles
 
Stanislav Khorunzhyi, "Front-end it like a PRO"
Sigma Software
 
ES6 Simplified
Carlos Ble
 
Ad

More from Fwdays (20)

PPTX
"Як ми переписали Сільпо на Angular", Євген Русаков
Fwdays
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
"Validation and Observability of AI Agents", Oleksandr Denisyuk
Fwdays
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
"Co-Authoring with a Machine: What I Learned from Writing a Book on Generativ...
Fwdays
 
PPTX
"Human-AI Collaboration Models for Better Decisions, Faster Workflows, and Cr...
Fwdays
 
PDF
"AI is already here. What will happen to your team (and your role) tomorrow?"...
Fwdays
 
PPTX
"Is it worth investing in AI in 2025?", Alexander Sharko
Fwdays
 
PDF
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
Fwdays
 
PDF
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
PDF
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
PDF
"Scaling in space and time with Temporal", Andriy Lupa .pdf
Fwdays
 
PPTX
"Provisioning via DOT-Chain: from catering to drone marketplaces", Volodymyr ...
Fwdays
 
PPTX
" Observability with Elasticsearch: Best Practices for High-Load Platform", A...
Fwdays
 
PPTX
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
PPTX
"Istio Ambient Mesh in production: our way from Sidecar to Sidecar-less",Hlib...
Fwdays
 
PPTX
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
PPTX
"Confidential AI: zero trust concept", Hennadiy Karpov
Fwdays
 
PPTX
"Choosing Tensor Accelerators for Specific Tasks: Compute vs Memory Bound Mod...
Fwdays
 
"Як ми переписали Сільпо на Angular", Євген Русаков
Fwdays
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
"Validation and Observability of AI Agents", Oleksandr Denisyuk
Fwdays
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
"Co-Authoring with a Machine: What I Learned from Writing a Book on Generativ...
Fwdays
 
"Human-AI Collaboration Models for Better Decisions, Faster Workflows, and Cr...
Fwdays
 
"AI is already here. What will happen to your team (and your role) tomorrow?"...
Fwdays
 
"Is it worth investing in AI in 2025?", Alexander Sharko
Fwdays
 
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
Fwdays
 
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
"Scaling in space and time with Temporal", Andriy Lupa .pdf
Fwdays
 
"Provisioning via DOT-Chain: from catering to drone marketplaces", Volodymyr ...
Fwdays
 
" Observability with Elasticsearch: Best Practices for High-Load Platform", A...
Fwdays
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
"Istio Ambient Mesh in production: our way from Sidecar to Sidecar-less",Hlib...
Fwdays
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
"Confidential AI: zero trust concept", Hennadiy Karpov
Fwdays
 
"Choosing Tensor Accelerators for Specific Tasks: Compute vs Memory Bound Mod...
Fwdays
 

Recently uploaded (20)

PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Digital Circuits, important subject in CS
contactparinay1
 

Роман Лютиков "Web Apps Performance & JavaScript Compilers"