SlideShare a Scribd company logo
Making Angular2 Lean and Fast
Vinci Rufus
@areai51
Angular2 Final Released
Give some
You have Changed !!!
Making Angular2 lean and Fast
2011 -2013
Sublime Text
~ 2014
Avg Human’s Attention Span
9 seconds8 seconds
(2013)
* Microsoft Attention Span Research Report
What’s taking you so long
The ng-show@ngConf 2016
• https://www.youtube.com/watch?v=aSFfLVxT5vA
Peek into the Angular2 Framework Platform
Angular 2
Mobile Server Material UI
CLI
IDE
&
TypeScript Augury
isAngular2 ===‘fast’
Angular2 performance
Render
2.5x Faster
Re-Render
4.2x Faster
Always
5x Faster
Angular2 Beta Final
Things that make Angular2 Fast …just some of them
Fast Change Detection
Unidirectional Data Flow
Lazy Loading of Routes
1
3
4
5
AoT Compilation
JavaScript VM
Friendly Code
Tree Shake !!
+
Angular 1.x
Angular 2
My India – Report Card
The journey
Numbers
4.5s
First Paint
2.9
Bundle size
MB
Ahead of Time (AoT)
The best thing ever since Angular
Just in Time (JIT)
Develop in
TypeScript
Compile
using tsc
Bundle &
Minify
Deploy
Download JS
Assets
Angular
Bootstraps
JIT
Compilation
Render App
App Development
App Rendering
Ahead of Time (AoT)
Develop in
TypeScript
Compile
using ngc
Bundle &
Minify
Deploy
Download JS Assets
Angular
Bootstraps
Render App
App Development
App Rendering
Angular
Templates+CSS
into TypeScript
TS into
JavaScript
Component.ts
Component.ngfactory.ts
Component.Metadata.json
app.component.ts
app.component.ngfactory.ts
app.component.metadata.json
Bootstrapping
Just In Time (JIT)
Ahead of Time (AoT)
54%
Bundle Size
0
0.5
1
1.5
2
2.5
3
3.5
JIT AoT
SizeinMB
Time to Load
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
JIT AoT
67%
Tree Shake
Rollup.js
Google Closure
Compiler
AoT+ Tree Shake  2.5x Smaller bundle sizes
2.9
1.334
0.261
0
0.5
1
1.5
2
2.5
3
3.5
JIT AoT Tree Shake +gzip
SizeinMB
Universal Rendering
…because first impressions matter.
Universal Rendering
Render the first page on the server and transfer state to client side once it is loaded
..more to come
Render Angular Universally using
Making Angular2 lean and Fast
The Uncanny Valley
Preboot to the Rescue
0
100
Initial
Request View Painted JS arrives JS parsed +evaled
Uncanny
Valley
Record Events Relay Events
Preboot.js
http://universal.angular.io
Web Workers
..the real workhorse
Main Thread
Web Workers in Angular
Angular Application
(View Parts)
Worker Thread
Angular Application
(CPU intensive Parts)
ClientMessageBroker ServiceMessageBroker
PWA & Service Workers
..the new kid on the block
"Its costs more to transmit a byte
than to compute it"
especially on mobile devices
App Shell
Model
Instant
Loading
Offline
Support
Progressive Web App
60 fps
Add to Home
Screen
Render Root
Component
Universally
Root
Component as
App Shell
Service
Worker
via CLI
Web Worker
Web App
Manifest
via CLI
Some Numbers
2356
287
128
0
500
1000
1500
2000
2500
Standard App Shell +Service worker
Timeinmsec
https://mobile.angular.io/
PWA
Web Workers
Universal
Ahead of Time (AoT)
+Tree Shake
For All
Applications
- Gets many new visitors
- SEO is important
- Social shares happen a lot
#eCommerce
- Need consistent 60 fps
- CPU Intensive Tasks
#Data Visualization, #Number Crunching
Truly Mobile First
Native App Replacement
The Crew
Aakash Keshav Siddharth Visweshwaran
Nisheed Shafeeq Anup Bhumika
जनहित में जारी
Be Nice!
to people
जनहित में जारी
Embrace
Diversity
In Opinions
Ways of working
Frameworks
I’m done!!
Promise
Observables

More Related Content

PPTX
Taking Control of your Data with GraphQL
PDF
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
PDF
GraphQL: The Missing Link Between Frontend and Backend Devs
PDF
Matheus Marsiglio - Isomorphic React + Redux App
PDF
The Apollo and GraphQL Stack
PDF
London React August - GraphQL at The Financial Times - Viktor Charypar
PDF
Serverless GraphQL for Product Developers
PPTX
Alfresco Digital Business Platform - Why, How, What
Taking Control of your Data with GraphQL
Meteor MIT Tech Talk 9/18/14: Designing a New Platform For Modern Apps
GraphQL: The Missing Link Between Frontend and Backend Devs
Matheus Marsiglio - Isomorphic React + Redux App
The Apollo and GraphQL Stack
London React August - GraphQL at The Financial Times - Viktor Charypar
Serverless GraphQL for Product Developers
Alfresco Digital Business Platform - Why, How, What

What's hot (20)

PDF
James Baxley - Statically typing your GraphQL app
PDF
Real-time GraphQL API with minimum coding and maximum benefit
PDF
Moving from app services to azure functions
PPTX
Alfresco Development Framework Basic
PDF
GraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
PPTX
GraphQL-ify your APIs - Devoxx UK 2021
PDF
GraphQL in an Age of REST
PDF
React and GraphQL at Stripe
PDF
GraphQL Europe Recap
PDF
How to Build Single Page HTML5 Apps that Scale
PDF
Rob Gruhl and Erik Erikson - What We Learned in 18 Serverless Months at Nords...
PDF
GraphQL IndyJS April 2016
PPTX
Serverless Orchestration with Azure Durable Functions
PDF
Chris Anderson and Yochay Kiriaty - Serverless Patterns with Azure Functions
PDF
The Graph-Native Advantage
PDF
Continuous Delivery in the Cloud with Bitbucket Pipelines
PDF
Scala on Rails #rakutentech
PDF
GraphQL With Relay Part Deux
PPTX
Serverless patterns v2 public
PPTX
Introduction to Azure Functions - Tutorial
James Baxley - Statically typing your GraphQL app
Real-time GraphQL API with minimum coding and maximum benefit
Moving from app services to azure functions
Alfresco Development Framework Basic
GraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
GraphQL-ify your APIs - Devoxx UK 2021
GraphQL in an Age of REST
React and GraphQL at Stripe
GraphQL Europe Recap
How to Build Single Page HTML5 Apps that Scale
Rob Gruhl and Erik Erikson - What We Learned in 18 Serverless Months at Nords...
GraphQL IndyJS April 2016
Serverless Orchestration with Azure Durable Functions
Chris Anderson and Yochay Kiriaty - Serverless Patterns with Azure Functions
The Graph-Native Advantage
Continuous Delivery in the Cloud with Bitbucket Pipelines
Scala on Rails #rakutentech
GraphQL With Relay Part Deux
Serverless patterns v2 public
Introduction to Azure Functions - Tutorial
Ad

Viewers also liked (9)

PDF
QuizUp Web Monorepo
PDF
Databinding and Performance-Tuning in Angular 2
PPTX
Angular PWA
PPTX
Jigsaw Puzzle Game!
PPTX
Performance Optimization In Angular 2
PPTX
Component lifecycle hooks in Angular 2.0
PPTX
Angular 2 - Ahead of-time Compilation
PDF
QuizUp Web Monorepo
Databinding and Performance-Tuning in Angular 2
Angular PWA
Jigsaw Puzzle Game!
Performance Optimization In Angular 2
Component lifecycle hooks in Angular 2.0
Angular 2 - Ahead of-time Compilation
Ad

Similar to Making Angular2 lean and Fast (20)

PPTX
It's just Angular
PPTX
Angular
PDF
Angular JS 2_0 BCS CTO_in_Res V3
PPTX
Getting Productive & Performant with Angular
PDF
Angular 2 - SSD 2016 London
PDF
El viaje de Angular1 a Angular2
PPTX
Finjs - Angular 2 better faster stronger
PDF
New World of Angular (v2+)
PPTX
"Product Architecture: failures and lessons learnt" - Royi Benyossef @Product...
PDF
Angular2 intro
PDF
The evolution of Angular 2 @ AngularJS Munich Meetup #5
PPTX
Angular elements - embed your angular components EVERYWHERE
PDF
Angular2 & Native Script GDG DevFest 2016
PDF
Angular (v2 and up) - Morning to understand - Linagora
PDF
Angular Extreme Performance - V2
PPTX
PDF
US Meetup Tour
PDF
[143]Inside fuse deview 2016
PDF
Angular meetup 2 2019-08-29
PDF
IVY: an overview
It's just Angular
Angular
Angular JS 2_0 BCS CTO_in_Res V3
Getting Productive & Performant with Angular
Angular 2 - SSD 2016 London
El viaje de Angular1 a Angular2
Finjs - Angular 2 better faster stronger
New World of Angular (v2+)
"Product Architecture: failures and lessons learnt" - Royi Benyossef @Product...
Angular2 intro
The evolution of Angular 2 @ AngularJS Munich Meetup #5
Angular elements - embed your angular components EVERYWHERE
Angular2 & Native Script GDG DevFest 2016
Angular (v2 and up) - Morning to understand - Linagora
Angular Extreme Performance - V2
US Meetup Tour
[143]Inside fuse deview 2016
Angular meetup 2 2019-08-29
IVY: an overview

More from Vinci Rufus (10)

PPTX
Microfrontends Monoreops & Trunkbased based
PPTX
Spas are dead Long Live Microfrontends
PPTX
Demand driven Applications with GraphQL
PPTX
Dos & Donts when making Technology choices
PPTX
Progressive Web App
PPTX
Re-thinking Performance tuning with HTTP2
PPTX
Teams Pizza Team vs Jigsaw Puzzle Team
PPTX
Gesture based Interactions in JavaScript
PPTX
Components Approach to building Web Apps
PPTX
Angular JS and Magento
Microfrontends Monoreops & Trunkbased based
Spas are dead Long Live Microfrontends
Demand driven Applications with GraphQL
Dos & Donts when making Technology choices
Progressive Web App
Re-thinking Performance tuning with HTTP2
Teams Pizza Team vs Jigsaw Puzzle Team
Gesture based Interactions in JavaScript
Components Approach to building Web Apps
Angular JS and Magento

Recently uploaded (20)

PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PPTX
artificialintelligenceai1-copy-210604123353.pptx
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PPTX
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
PPTX
international classification of diseases ICD-10 review PPT.pptx
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PPTX
Module 1 - Cyber Law and Ethics 101.pptx
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PPTX
SAP Ariba Sourcing PPT for learning material
PPTX
presentation_pfe-universite-molay-seltan.pptx
PPTX
Introuction about WHO-FIC in ICD-10.pptx
PDF
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
PDF
Cloud-Scale Log Monitoring _ Datadog.pdf
PPT
Ethics in Information System - Management Information System
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PPTX
Power Point - Lesson 3_2.pptx grad school presentation
PPT
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt
522797556-Unit-2-Temperature-measurement-1-1.pptx
artificialintelligenceai1-copy-210604123353.pptx
introduction about ICD -10 & ICD-11 ppt.pptx
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
international classification of diseases ICD-10 review PPT.pptx
WebRTC in SignalWire - troubleshooting media negotiation
Tenda Login Guide: Access Your Router in 5 Easy Steps
Module 1 - Cyber Law and Ethics 101.pptx
SASE Traffic Flow - ZTNA Connector-1.pdf
Job_Card_System_Styled_lorem_ipsum_.pptx
SAP Ariba Sourcing PPT for learning material
presentation_pfe-universite-molay-seltan.pptx
Introuction about WHO-FIC in ICD-10.pptx
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
Cloud-Scale Log Monitoring _ Datadog.pdf
Ethics in Information System - Management Information System
Unit-1 introduction to cyber security discuss about how to secure a system
PptxGenJS_Demo_Chart_20250317130215833.pptx
Power Point - Lesson 3_2.pptx grad school presentation
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt

Making Angular2 lean and Fast

Editor's Notes

  • #2: Stand up Universal technques No need for NG2 knowledge
  • #4: Give me some love Put things behind us Love Meta refresh feedbaack
  • #5: The first question that arises after having a quick look at Angular2.. Is you’ve changed so much !!!
  • #6: Back in the days, expectations from JS fameworks were rather simple… All we wanted was avoiding round trips to the server and a more desktop like experience people wanted SPAs and they were ready to wait for a few extra seconds for the browser to load the framework library to enjoy that experience. Life was a lot easy for developers too.. Load the library file via a script tag and start writing code.
  • #7: What has also changed a lot is also the tools we use. In those good old days most of us relied on these basic tools Today not only a lot more tools have been added tool our toolkit, we have have more choices of the tools.
  • #8: Speed and performance matters Relevant to today’s time
  • #10: This 3 min clip from the truly funny talk at NG-Conf should give an idea of why its taking so long
  • #11: I’m sure many of you are thinking that’s the problem… they are jumping into too many things.. They should just focus on one single thing and get it right.. And if you asked me.. I too thought the same.. And many other frameworks are doing that… But then we as engineers or architects we need to worry about the whole solution, our consumers are not going to be satisfied with we doing that that one thing perfectly. And this is actually what makes Angular stand out. Angular2 has evolved into from being a framework to a platform that will allow us as developers to build entire solutions that will give our consumers a great user experience.
  • #16: Need to Update the numbers based on the default out of box deployment of the app
  • #28: The reason we do Universal rendering is because we would like Faster Views for first time Users Better Indexing by Search engines Image previews on Social Shares
  • #29: The decoupling of the application layer form the Renderr allows us to easily render our app for the server and browser and also switch between them
  • #30: Paul Lewis tweeted about the Uncanny Valley, where the user is lost/confused during the time the server side view has been generated and the user is able to see the page but is unable to interact with the page because the client side code hasn’t downloaded and taken control
  • #31: Preboot a small library form Universal tries to solve the problem. It injects itself into the head of the server side rendered page and records the user actions. Once the client side has been loaded, it relays these actions to the client app which performances the actions.
  • #39: The mobile toolkit at mobile.angular.io makes it very easy to get started with building PWAs with Angular.
  • #42: In our quest for being opinionated, we have started becoming cynical. We like to surround ourselves with all the fancy jargons and like to show off all the cool stuff we know. We’ve sort of created an atomosphere that is intimidating for people from other streams to enter our space.
  • #43: History has shown the JS community rarely comes to a consensus on things , be is OOPs, Functional programing, reactive programming, static types etc. We need to Embrace Diversity and learn from the good things in others and implement it in our work.