SlideShare a Scribd company logo
Bundling: you are doing it wrong
Aleksey Shvayka @ Hell Yeah LLC
@shvaikalesh
Алексей Швайка "Bundling: you are doing it wrong"
Front End performance
Performance is a feature
Performance matters
We optimize wrong
Hacks
• Sprites
• Inlining
• Sharding
• Concatenation
• Cookieless domains
lodash vs native
Optimizing for V8
<button> is slow
The cost of transpiling in 2016
jQuery vs DOM4
Алексей Швайка "Bundling: you are doing it wrong"
Алексей Швайка "Bundling: you are doing it wrong"
AMP: good parts
• <script async>
• GPU animations
• Font optimization
• DOM read/write batching
• Microdata (JSON-LD)
Best practices
• <script async>
• GPU animations
• Font optimization
• DOM read/write batching
• Microdata (JSON-LD)
AMP: bad parts
• No <input>, <form>, <picture>
• Inlined CSS
• CSS micro-optimizations
• Invalid attributes
• <noscript>
Protocol is bottleneck
Brief history of HTTP
GET /http/0.9.html
<hypertext response>
GET /http/0.9.html
[connection closed]
HTTP/1.0
• Versioning, headers, methods
• Simple caching, basic auth
• Status codes
HTTP/1.1
• Advanced caching, Vary
• Range requests
• Compression, chunked
• Content negotiation
• OPTIONS method
HTTP/2
• Backwards compatible
• Great multiplexing
• Streams/frames
• Server push, PING, GOAWAY
spdy.createServer(tls, (req, res) => {
res.push('/main.js', (err, stream) => {
stream.end('console.log("hello, world!")')
})
res.end('<script src="/main.js"></script>')
}).listen(443)
Hacks HTTP/2
• Sprites Separate resources
• Inlining Server push
• Sharding Single host
• Concatenation Separate resources
• Cookieless domains Single host
HTTP/2 rollout
• Gradual
• Right away
• “Hack” per request
• When % of traffic will support it
SPDY
• IE 11
• Firefox
• Chrome
• Android 4
• Safari 8
HTTP/2
• IE 11
• Edge
• Firefox 41
• Chrome 36
• Safari 9
HTTP/2
• IE 11 (Windows 10)
• Edge (over TLS)
• Firefox 41 (over TLS)
• Chrome 36 (over TLS)
• Safari 9 (OS X El Capitan)
Why TLS is enforced?
Is not that slow?
CSS
Critical above-the-fold CSS
loadCSS.js
<body><link></body>
<link> unblocks content above
JavaScript
300 <script>s?
1. AMD
Алексей Швайка "Bundling: you are doing it wrong"
Алексей Швайка "Bundling: you are doing it wrong"
2. CommonJS
Preprocessing?
Bundling? AMD?
var modules = Object.create(null)
window.module = {
get exports() {
return modules[src()]
},
set exports(value) {
modules[src()] = value
}
}
var modules = Object.create(null)
window.module = {
get exports() {
return modules[src()]
},
set exports(value) {
modules[src()] = value
}
}
window.require = function(path) {
return modules[resolve(src(), path)]
}
var modules = Object.create(null)
window.module = {
get exports() {
return modules[src()]
},
set exports(value) {
modules[src()] = value
}
}
window.require = function(path) {
return modules[resolve(src(), path)]
}
function src() {
return document.currentScript.src
}
document.currentScript
var $scripts = document.getElementsByTagName("script")
var loaded = Object.create(null)
var $scripts = document.getElementsByTagName("script")
var loaded = Object.create(null)
document.addEventListener("load", function(event) {
var $target = event.target
if ($target.matches("script")) {
var source = $target.src
if (source) loaded[source] = null
}
}, true)
var $scripts = document.getElementsByTagName("script")
var loaded = Object.create(null)
document.addEventListener("load", function(event) {
var $target = event.target
if ($target.matches("script")) {
var source = $target.src
if (source) loaded[source] = null
}
}, true)
return searchStack(new Error().stack, function(source) {
if (source in loaded) return
return $scripts.find(function($script) {
return $script.src == source
})
})
3. ES6 Modules
When:
Spec for module loader?
whatwg/html/pull/443
<script type=module>
Алексей Швайка "Bundling: you are doing it wrong"
Features
• Only absolute or '/', './', '../'
• <script defer> semantics
• Module memorization
• CORS, UTF-8, enforced Content-Type
When:
first implementation?
bugs/webkit/id/148689
Using today?

More Related Content

PDF
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Fwdays
 
PPTX
Development of automated tests for ext js based web sites
ISsoft
 
PDF
BP101: A Modernized Workflow w/ Domino/XPages
edm00se
 
PDF
Quick start with AngularJS
Iuliia Baranova
 
PDF
Write Once, Run Everywhere - Ember.js Munich
Mike North
 
PDF
Conquering AngularJS Limitations
Valeri Karpov
 
PPTX
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
Srijan Technologies
 
PPTX
React basic by Yoav Amit, Wix
Chen Lerner
 
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Fwdays
 
Development of automated tests for ext js based web sites
ISsoft
 
BP101: A Modernized Workflow w/ Domino/XPages
edm00se
 
Quick start with AngularJS
Iuliia Baranova
 
Write Once, Run Everywhere - Ember.js Munich
Mike North
 
Conquering AngularJS Limitations
Valeri Karpov
 
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
Srijan Technologies
 
React basic by Yoav Amit, Wix
Chen Lerner
 

What's hot (20)

PDF
Integrating React.js Into a PHP Application
Andrew Rota
 
PPTX
Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...
Dakiry
 
PDF
React && React Native workshop
Stacy Goh
 
PDF
Frontend Application Architecture, Patterns, and Workflows
Treasure Data, Inc.
 
PPTX
React in Native Apps - Meetup React - 20150409
Minko3D
 
PDF
Learning React - I
Mitch Chen
 
PPTX
Silicon Valley JUG - How to generate customized java 8 code from your database
Speedment, Inc.
 
PPTX
Iconus 2016
Mark Roden
 
PDF
Introduction to react
kiranabburi
 
PDF
The Complementarity of React and Web Components
Andrew Rota
 
PDF
Client Vs. Server Rendering
David Amend
 
PDF
CQ5 and Sling overview
Bertrand Delacretaz
 
PPTX
My first powershell script
David Cobb
 
PDF
AngularJS + React
justvamp
 
KEY
Capybara-Webkit
bostonrb
 
PDF
React native: building native iOS apps with javascript
Polidea
 
PDF
John Resig Beijing 2010 (English Version)
Jia Mi
 
PDF
RESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff Norris
mfrancis
 
PPTX
Test driven development v1.0
Ganesh Kondal
 
PPTX
Combining Angular and React Together
Sebastian Pederiva
 
Integrating React.js Into a PHP Application
Andrew Rota
 
Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...
Dakiry
 
React && React Native workshop
Stacy Goh
 
Frontend Application Architecture, Patterns, and Workflows
Treasure Data, Inc.
 
React in Native Apps - Meetup React - 20150409
Minko3D
 
Learning React - I
Mitch Chen
 
Silicon Valley JUG - How to generate customized java 8 code from your database
Speedment, Inc.
 
Iconus 2016
Mark Roden
 
Introduction to react
kiranabburi
 
The Complementarity of React and Web Components
Andrew Rota
 
Client Vs. Server Rendering
David Amend
 
CQ5 and Sling overview
Bertrand Delacretaz
 
My first powershell script
David Cobb
 
AngularJS + React
justvamp
 
Capybara-Webkit
bostonrb
 
React native: building native iOS apps with javascript
Polidea
 
John Resig Beijing 2010 (English Version)
Jia Mi
 
RESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff Norris
mfrancis
 
Test driven development v1.0
Ganesh Kondal
 
Combining Angular and React Together
Sebastian Pederiva
 
Ad

Viewers also liked (20)

PDF
Paul Miller "Как подняться на open source"
Fwdays
 
PPTX
Игорь Фесенко "Web Apps Performance & JavaScript Compilers"
Fwdays
 
PPTX
Илья Климов "О драконах ни слова"
Fwdays
 
PDF
Григорий Шехет "Treasure hunt in the land of Reactive frameworks"
Fwdays
 
PDF
Алексей Рыбаков: "Wearable OS год спустя: Apple Watch 2.0, Android Wear 5.1.1...
Fwdays
 
PDF
"Frameworks in 2015" Андрей Листочкин
Fwdays
 
PDF
Евгений Жарков AngularJS: Good parts
Fwdays
 
PDF
Илья Прукко: "Как дизайнеру не становиться художником"
Fwdays
 
PDF
Анастасия Войтова: "Building profanity filters on mobile: clbuttic sh!t"
Fwdays
 
PDF
Fighting Fat Models (Богдан Гусев)
Fwdays
 
PPTX
Сергей Жук "Android Performance Tips & Tricks"
Fwdays
 
PDF
Скрам и Канбан: применимость самых распространенных методов организации умств...
Fwdays
 
PPT
"Spring Boot. Boot up your development" Сергей Моренец
Fwdays
 
PPTX
Трансформация команды: от инди разработки к играм с коммерческой успешностью
Fwdays
 
PDF
"После OOD: как моделировать предметную область в пост-объектном мире" Руслан...
Fwdays
 
PPTX
"Красная книга веб-разработчика" Виктор Полищук
Fwdays
 
PPTX
"Query Execution: Expectation - Reality (Level 300)" Денис Резник
Fwdays
 
PDF
Александр Махомет "Feature Flags. Уменьшаем риски при выпуске изменений"
Fwdays
 
PDF
Светлана Старикова "Building a self-managing team: why you should not have e...
Fwdays
 
PDF
Александр Воронов | Building CLI with Swift
Fwdays
 
Paul Miller "Как подняться на open source"
Fwdays
 
Игорь Фесенко "Web Apps Performance & JavaScript Compilers"
Fwdays
 
Илья Климов "О драконах ни слова"
Fwdays
 
Григорий Шехет "Treasure hunt in the land of Reactive frameworks"
Fwdays
 
Алексей Рыбаков: "Wearable OS год спустя: Apple Watch 2.0, Android Wear 5.1.1...
Fwdays
 
"Frameworks in 2015" Андрей Листочкин
Fwdays
 
Евгений Жарков AngularJS: Good parts
Fwdays
 
Илья Прукко: "Как дизайнеру не становиться художником"
Fwdays
 
Анастасия Войтова: "Building profanity filters on mobile: clbuttic sh!t"
Fwdays
 
Fighting Fat Models (Богдан Гусев)
Fwdays
 
Сергей Жук "Android Performance Tips & Tricks"
Fwdays
 
Скрам и Канбан: применимость самых распространенных методов организации умств...
Fwdays
 
"Spring Boot. Boot up your development" Сергей Моренец
Fwdays
 
Трансформация команды: от инди разработки к играм с коммерческой успешностью
Fwdays
 
"После OOD: как моделировать предметную область в пост-объектном мире" Руслан...
Fwdays
 
"Красная книга веб-разработчика" Виктор Полищук
Fwdays
 
"Query Execution: Expectation - Reality (Level 300)" Денис Резник
Fwdays
 
Александр Махомет "Feature Flags. Уменьшаем риски при выпуске изменений"
Fwdays
 
Светлана Старикова "Building a self-managing team: why you should not have e...
Fwdays
 
Александр Воронов | Building CLI with Swift
Fwdays
 
Ad

Similar to Алексей Швайка "Bundling: you are doing it wrong" (20)

PPTX
JavaScript Performance Patterns
Stoyan Stefanov
 
PDF
Web Performance Part 4 "Client-side performance"
Binary Studio
 
PPTX
JavaScript performance patterns
Stoyan Stefanov
 
PPTX
JavaScript front end performance optimizations
Chris Love
 
PDF
Metarefresh
Aakash Bapna
 
PPTX
My weekend startup: seocrawler.co
Hrvoje Hudoletnjak
 
PPTX
DOTNET8.pptx
Udaiappa Ramachandran
 
PPTX
How to generate customized java 8 code from your database
Speedment, Inc.
 
PDF
Everything is Awesome - Cutting the Corners off the Web
James Rakich
 
PDF
Developing High Performance Web Apps
Timothy Fisher
 
PPTX
Edge of the Web
Todd Anglin
 
PDF
Progressive Downloads and Rendering
Stoyan Stefanov
 
KEY
Developing High Performance Web Apps - CodeMash 2011
Timothy Fisher
 
PDF
Cape Cod Web Technology Meetup - 2
Asher Martin
 
ODP
Presentation of JSConf.eu
Fredrik Wendt
 
PPTX
Vlad zelinschi optimizing the critical rendering path
Codecamp Romania
 
PPTX
ASP.NET: Present and future
Hrvoje Hudoletnjak
 
PDF
Seven Versions of One Web Application
Yakov Fain
 
PPTX
Javascript for Wep Apps
Michael Puckett
 
PDF
LA Ember.js Meetup, Jan 2017
Matthew Beale
 
JavaScript Performance Patterns
Stoyan Stefanov
 
Web Performance Part 4 "Client-side performance"
Binary Studio
 
JavaScript performance patterns
Stoyan Stefanov
 
JavaScript front end performance optimizations
Chris Love
 
Metarefresh
Aakash Bapna
 
My weekend startup: seocrawler.co
Hrvoje Hudoletnjak
 
DOTNET8.pptx
Udaiappa Ramachandran
 
How to generate customized java 8 code from your database
Speedment, Inc.
 
Everything is Awesome - Cutting the Corners off the Web
James Rakich
 
Developing High Performance Web Apps
Timothy Fisher
 
Edge of the Web
Todd Anglin
 
Progressive Downloads and Rendering
Stoyan Stefanov
 
Developing High Performance Web Apps - CodeMash 2011
Timothy Fisher
 
Cape Cod Web Technology Meetup - 2
Asher Martin
 
Presentation of JSConf.eu
Fredrik Wendt
 
Vlad zelinschi optimizing the critical rendering path
Codecamp Romania
 
ASP.NET: Present and future
Hrvoje Hudoletnjak
 
Seven Versions of One Web Application
Yakov Fain
 
Javascript for Wep Apps
Michael Puckett
 
LA Ember.js Meetup, Jan 2017
Matthew Beale
 

More from Fwdays (20)

PDF
"Mastering UI Complexity: State Machines and Reactive Patterns at Grammarly",...
Fwdays
 
PDF
"Effect, Fiber & Schema: tactical and technical characteristics of Effect.ts"...
Fwdays
 
PPTX
"Computer Use Agents: From SFT to Classic RL", Maksym Shamrai
Fwdays
 
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
 
"Mastering UI Complexity: State Machines and Reactive Patterns at Grammarly",...
Fwdays
 
"Effect, Fiber & Schema: tactical and technical characteristics of Effect.ts"...
Fwdays
 
"Computer Use Agents: From SFT to Classic RL", Maksym Shamrai
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
 

Recently uploaded (20)

PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
The Future of Artificial Intelligence (AI)
Mukul
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 

Алексей Швайка "Bundling: you are doing it wrong"