This document summarizes techniques for optimizing Angular applications, including ahead-of-time compilation, lazy loading, change detection strategies, avoiding memory leaks, and server-side rendering. It provides code examples and compares the performance of different approaches by measuring load times. The main takeaways are that ahead-of-time compilation, lazy loading, and server-side rendering can each significantly improve load performance, and that change detection strategies and unsubscribing from observables are important for memory usage and efficiency.
The whole workshop is open source: https://github.com/georgiee/angular-workshop-skipbo
---
Angular Advanced Workshop we gave for KaiserX (Allianz, Dec 2018) to teach advanced topics of Angular in a playful way.
The workshop covered six chapters:
Modules, Components, Routing, RxJS, Testing & Animations.
Each Chapter included a challenge, a markdown document describing step by step what to do while giving challenging tasks to solve. The challenges include git branches to catch up if someone gets lost.
We even covered advanced topics like the event loop (micro/macro tasks), zone.js, onPush, ChangeDetection & switchMap vs mergeMap. I'm so happy that I could share this knowledge and people understood it.
By following my workshop, all 15 developers created a fully working Skip-Bo game within three days. There are animations, advanced unit tests, a implemented AI called Oscar to play for the CPU opponents and so much more!
And the best part
We made everything open source. The whole workshop can be found on github: https://github.com/georgiee/angular-workshop-skipbo
Here the final result:
https://skipbo-angular-workshop.netlify.com
The whole workshop is open source: https://github.com/georgiee/angular-workshop-skipbo
---
Angular Advanced Workshop we gave for KaiserX (Allianz, Dec 2018) to teach advanced topics of Angular in a playful way.
The workshop covered six chapters:
Modules, Components, Routing, RxJS, Testing & Animations.
Each Chapter included a challenge, a markdown document describing step by step what to do while giving challenging tasks to solve. The challenges include git branches to catch up if someone gets lost.
We even covered advanced topics like the event loop (micro/macro tasks), zone.js, onPush, ChangeDetection & switchMap vs mergeMap. I'm so happy that I could share this knowledge and people understood it.
By following my workshop, all 15 developers created a fully working Skip-Bo game within three days. There are animations, advanced unit tests, a implemented AI called Oscar to play for the CPU opponents and so much more!
And the best part
We made everything open source. The whole workshop can be found on github: https://github.com/georgiee/angular-workshop-skipbo
Here the final result:
https://skipbo-angular-workshop.netlify.com
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3Elixir Club
Доповідь Максима Пугача, Team Lead/Software Engineer at LITSLINK, на Elixir Evening Club 3, Kyiv, 13.12.2018
Наступна конференція - http://www.elixirkyiv.club/
A boss of mine once told me "Just see, my poorly written Vert.x app outperforms my poorly written Elixir app". Now it is time to take up the gauntlet.
Cлідкуйте за нами у соцмережах @ElixirClubUA та #ElixirClubUA
Анонси та матеріали конференцій - https://www.fb.me/ElixirClubUA
Новини - https://twitter.com/ElixirClubUA
Фото та невимушена атмосфера - https://www.instagram.com/ElixirClubUA
*Канал організаторів мітапа - https://t.me/incredevly
Technologies are ever changing and since we're building our applications on the shoulders of giants like Babel,... We have to stay up-to-date with the newest trends.
We at Codifly strongly believe in using the newest technologies, that's why we've organised a meetup to showcase these for you. This event was organised in collaboration with ITLab HoGent at Campus Schoonmeersen (Voskenslaan 270, 9000 Ghent).
A certain level of knowledge about these subjects is required since we're mostly be going over the recent changes. For Babel we're discussing what's new in their upcoming version 7, for Webpack the changes from 3 -> 4.6 will be discussed and for React all the new features in React 16.3 and the upcoming ones.
Amazon has been using and building workflow services for years now. They use Simple Workflow (SWF) internally to lay down OS and all required software onto a new Amazon server before it joins Amazon fleet. Every Amazon server being put in service is provisioned in a workflow using SWF.
During this brown-bag session you will be taken through the example of real application which uses SWF.
Presentation I gave to the node.dc meetup group March 13, 2013 on using Promises and the Q library to make flow of control easier to reason about in Javascript code using async and callbacks
A code kata in C# to help practice techniques for safely removing dependencies form legacy code and creating unit tests. Questions? Suggestions? Contact @dubmun.
Having trouble wrapping you mind around unit testing in legacy code? Practice this kata and you'll have a good understanding of some basics. Break dependencies, inject stubs, write meaningful tests. Refactor with confidence. Version 2 is a complete overhaul to make the kata more readable and usable.
HKG15-204: OpenStack: 3rd party testing and performance benchmarkingLinaro
HKG15-204: OpenStack: 3rd party testing and performance benchmarking
---------------------------------------------------
Speaker: Andrew McDermott, Clark Laughlin
Date: February 10, 2015
---------------------------------------------------
★ Session Summary ★
Status of Tempest 3rd party testing, discussion on scenarii for Rally benchmarking and hypervisor performance.
--------------------------------------------------
★ Resources ★
Pathable: https://hkg15.pathable.com/meetings/250785
Video: https://www.youtube.com/watch?v=-00rTPCYAyg
Etherpad: http://pad.linaro.org/p/hkg15-204
---------------------------------------------------
★ Event Details ★
Linaro Connect Hong Kong 2015 - #HKG15
February 9-13th, 2015
Regal Airport Hotel Hong Kong Airport
---------------------------------------------------
http://www.linaro.org
http://connect.linaro.org
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3Elixir Club
Доповідь Максима Пугача, Team Lead/Software Engineer at LITSLINK, на Elixir Evening Club 3, Kyiv, 13.12.2018
Наступна конференція - http://www.elixirkyiv.club/
A boss of mine once told me "Just see, my poorly written Vert.x app outperforms my poorly written Elixir app". Now it is time to take up the gauntlet.
Cлідкуйте за нами у соцмережах @ElixirClubUA та #ElixirClubUA
Анонси та матеріали конференцій - https://www.fb.me/ElixirClubUA
Новини - https://twitter.com/ElixirClubUA
Фото та невимушена атмосфера - https://www.instagram.com/ElixirClubUA
*Канал організаторів мітапа - https://t.me/incredevly
Technologies are ever changing and since we're building our applications on the shoulders of giants like Babel,... We have to stay up-to-date with the newest trends.
We at Codifly strongly believe in using the newest technologies, that's why we've organised a meetup to showcase these for you. This event was organised in collaboration with ITLab HoGent at Campus Schoonmeersen (Voskenslaan 270, 9000 Ghent).
A certain level of knowledge about these subjects is required since we're mostly be going over the recent changes. For Babel we're discussing what's new in their upcoming version 7, for Webpack the changes from 3 -> 4.6 will be discussed and for React all the new features in React 16.3 and the upcoming ones.
Amazon has been using and building workflow services for years now. They use Simple Workflow (SWF) internally to lay down OS and all required software onto a new Amazon server before it joins Amazon fleet. Every Amazon server being put in service is provisioned in a workflow using SWF.
During this brown-bag session you will be taken through the example of real application which uses SWF.
Presentation I gave to the node.dc meetup group March 13, 2013 on using Promises and the Q library to make flow of control easier to reason about in Javascript code using async and callbacks
A code kata in C# to help practice techniques for safely removing dependencies form legacy code and creating unit tests. Questions? Suggestions? Contact @dubmun.
Having trouble wrapping you mind around unit testing in legacy code? Practice this kata and you'll have a good understanding of some basics. Break dependencies, inject stubs, write meaningful tests. Refactor with confidence. Version 2 is a complete overhaul to make the kata more readable and usable.
HKG15-204: OpenStack: 3rd party testing and performance benchmarkingLinaro
HKG15-204: OpenStack: 3rd party testing and performance benchmarking
---------------------------------------------------
Speaker: Andrew McDermott, Clark Laughlin
Date: February 10, 2015
---------------------------------------------------
★ Session Summary ★
Status of Tempest 3rd party testing, discussion on scenarii for Rally benchmarking and hypervisor performance.
--------------------------------------------------
★ Resources ★
Pathable: https://hkg15.pathable.com/meetings/250785
Video: https://www.youtube.com/watch?v=-00rTPCYAyg
Etherpad: http://pad.linaro.org/p/hkg15-204
---------------------------------------------------
★ Event Details ★
Linaro Connect Hong Kong 2015 - #HKG15
February 9-13th, 2015
Regal Airport Hotel Hong Kong Airport
---------------------------------------------------
http://www.linaro.org
http://connect.linaro.org
Adding a modern twist to legacy web applicationsJeff Durta
Avoid misery of working with legacy code
We will see how you can add independent and isolated components to existing pages; pages that may be difficult to change
React and Flux allow you to make self-contained additions that handle their own data access/persistence
Fundamental Concepts of React JS for Beginners.pdfStephieJohn
Let’s look into the Fundamental concepts of React Js for beginners by Lia Infraservices – The top Mobile App Development Company in Chennai. React is a front-end open source JavaScript library for creating user interfaces (UI) components. Complex user interfaces are broken down into small “components,” which are separate pieces of “reusable codes”.
Integration testing is hard, and often teams are tempted to do it in production. Testcontainers allows writing meaningful integration tests spawning Docker containers for databases, queue systems, kv-store, other services. The talk, a blend of slides and live code, will show how we are able to deploy without fear while integrating with a dozen of different datastores. Don't mock your database with fake data anymore, work with real data
Apache Accumulo (like all distributed, data stores) provides scalability at the cost of increased complexity. While Accumulo’s algorithms for handling fault tolerance or distributing load across a cluster may always be complex to the average Accumulo user, there are parts of Accumulo that can be simplified and improved to provide a better user experience. It should be easy for users to install and run Accumulo, write a simple Accumulo client, and troubleshoot common issues. This talk will cover how the Accumulo user experience has improved with Accumulo 2.0 and the creation of the Uno and Muchos tools. The talk will end with a discussion of possible future work to make the user experience better.
react-slides.pdf gives information about react libraryjanet736113
React is a framework that employs Webpack to automatically compile React, JSX, and ES6 code while handling CSS file prefixes. React is a JavaScript-based UI development library. Although React is a library rather than a language, it is widely used in web development. The library first appeared in May 2013 and is now one of the most commonly used frontend libraries for web development.
React offers various extensions for entire application architectural support, such as Flux and React Native, beyond mere UI,When compared to other technologies on the market, React is a new technology. Jordan Walke, a software engineer at Facebook, founded the library in 2011, giving it life. The likes of XHP, a straightforward HTML component framework for PHP, have an influence on React. React's newsfeed was its debut application in 2011. Later, Instagram picks it up and incorporates it into their platform,
Advantages
Makes use of the JavaScript structure known as virtual DOM. Since JavaScript's virtual DOM is quicker than the conventional DOM, this will boost the speed of programs.
Can be used with various systems and on both client and server sides is commendable.
Components and identify trends make larger apps easier to manage by increasing clarity.
Limitations
Only addresses the app's angle and distance; as a result, additional techniques must be selected if you want a full collection of development tools.
Employs inline scripting and JSX, which some programmers might find uncomfortable.
Our tech process, how we make apps using React Native on Gitlab with Gitlab CI (Continuous Integration) and CD (Continuous Delivery)
Reveal JS source on GitHub: https://github.com/Lingvokot/gitlab-and-lingvokot
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years laterHaehnchen
In 2013 the "Symfony Plugin" for PhpStorm was born. Today we see over 1 million downloads and several other plugins for projects like Laravel, Drupal, Shopware, ... that help to improve your productivity.
I will talk about Symfony related features and will give you some tips and tricks. Also, we take a look at the infrastructure behind these plugins and how I maintain all of them.
How to Implement Micro Frontend Architecture using Angular FrameworkRapidValue
Micro-frontends are small applications mostly divided by subdomain or functionality working together to deliver a larger application. Sometimes your frontend app might be a small part of another big application or your app consists a lot of sections and features which are developed by different teams or your app is being released into production feature by feature with developed by separate teams. If you are in one of these situations then you need to think about Micro Frontends. For more information visit: https://www.rapidvaluesolutions.com/
Talk at RubyKaigi 2015.
Plugin architecture is known as a technique that brings extensibility to a program. Ruby has good language features for plugins. RubyGems.org is an excellent platform for plugin distribution. However, creating plugin architecture is not as easy as writing code without it: plugin loader, packaging, loosely-coupled API, and performance. Loading two versions of a gem is a unsolved challenge that is solved in Java on the other hand.
I have designed some open-source software such as Fluentd and Embulk. They provide most of functions by plugins. I will talk about their plugin-based architecture.
Similar to Angular Optimization Web Performance Meetup (20)
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus
As part of the DOE Integrated Research Infrastructure (IRI) program, NERSC at Lawrence Berkeley National Lab and ALCF at Argonne National Lab are working closely with General Atomics on accelerating the computing requirements of the DIII-D experiment. As part of the work the team is investigating ways to speedup the time to solution for many different parts of the DIII-D workflow including how they run jobs on HPC systems. One of these routes is looking at Globus Compute as a way to replace the current method for managing tasks and we describe a brief proof of concept showing how Globus Compute could help to schedule jobs and be a tool to connect compute at different facilities.
OpenMetadata Community Meeting - 5th June 2024OpenMetadata
The OpenMetadata Community Meeting was held on June 5th, 2024. In this meeting, we discussed about the data quality capabilities that are integrated with the Incident Manager, providing a complete solution to handle your data observability needs. Watch the end-to-end demo of the data quality features.
* How to run your own data quality framework
* What is the performance impact of running data quality frameworks
* How to run the test cases in your own ETL pipelines
* How the Incident Manager is integrated
* Get notified with alerts when test cases fail
Watch the meeting recording here - https://www.youtube.com/watch?v=UbNOje0kf6E
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
Utilocate offers a comprehensive solution for locate ticket management by automating and streamlining the entire process. By integrating with Geospatial Information Systems (GIS), it provides accurate mapping and visualization of utility locations, enhancing decision-making and reducing the risk of errors. The system's advanced data analytics tools help identify trends, predict potential issues, and optimize resource allocation, making the locate ticket management process smarter and more efficient. Additionally, automated ticket management ensures consistency and reduces human error, while real-time notifications keep all relevant personnel informed and ready to respond promptly.
The system's ability to streamline workflows and automate ticket routing significantly reduces the time taken to process each ticket, making the process faster and more efficient. Mobile access allows field technicians to update ticket information on the go, ensuring that the latest information is always available and accelerating the locate process. Overall, Utilocate not only enhances the efficiency and accuracy of locate ticket management but also improves safety by minimizing the risk of utility damage through precise and timely locates.
E-commerce Application Development Company.pdfHornet Dynamics
Your business can reach new heights with our assistance as we design solutions that are specifically appropriate for your goals and vision. Our eCommerce application solutions can digitally coordinate all retail operations processes to meet the demands of the marketplace while maintaining business continuity.
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
JASMIN is the UK’s high-performance data analysis platform for environmental science, operated by STFC on behalf of the UK Natural Environment Research Council (NERC). In addition to its role in hosting the CEDA Archive (NERC’s long-term repository for climate, atmospheric science & Earth observation data in the UK), JASMIN provides a collaborative platform to a community of around 2,000 scientists in the UK and beyond, providing nearly 400 environmental science projects with working space, compute resources and tools to facilitate their work. High-performance data transfer into and out of JASMIN has always been a key feature, with many scientists bringing model outputs from supercomputers elsewhere in the UK, to analyse against observational or other model data in the CEDA Archive. A growing number of JASMIN users are now realising the benefits of using the Globus service to provide reliable and efficient data movement and other tasks in this and other contexts. Further use cases involve long-distance (intercontinental) transfers to and from JASMIN, and collecting results from a mobile atmospheric radar system, pushing data to JASMIN via a lightweight Globus deployment. We provide details of how Globus fits into our current infrastructure, our experience of the recent migration to GCSv5.4, and of our interest in developing use of the wider ecosystem of Globus services for the benefit of our user community.
Zoom is a comprehensive platform designed to connect individuals and teams efficiently. With its user-friendly interface and powerful features, Zoom has become a go-to solution for virtual communication and collaboration. It offers a range of tools, including virtual meetings, team chat, VoIP phone systems, online whiteboards, and AI companions, to streamline workflows and enhance productivity.
In the ever-evolving landscape of technology, enterprise software development is undergoing a significant transformation. Traditional coding methods are being challenged by innovative no-code solutions, which promise to streamline and democratize the software development process.
This shift is particularly impactful for enterprises, which require robust, scalable, and efficient software to manage their operations. In this article, we will explore the various facets of enterprise software development with no-code solutions, examining their benefits, challenges, and the future potential they hold.
Do you want Software for your Business? Visit Deuglo
Deuglo has top Software Developers in India. They are experts in software development and help design and create custom Software solutions.
Deuglo follows seven steps methods for delivering their services to their customers. They called it the Software development life cycle process (SDLC).
Requirement — Collecting the Requirements is the first Phase in the SSLC process.
Feasibility Study — after completing the requirement process they move to the design phase.
Design — in this phase, they start designing the software.
Coding — when designing is completed, the developers start coding for the software.
Testing — in this phase when the coding of the software is done the testing team will start testing.
Installation — after completion of testing, the application opens to the live server and launches!
Maintenance — after completing the software development, customers start using the software.
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppGoogle
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-fusion-buddy-review
AI Fusion Buddy Review: Key Features
✅Create Stunning AI App Suite Fully Powered By Google's Latest AI technology, Gemini
✅Use Gemini to Build high-converting Converting Sales Video Scripts, ad copies, Trending Articles, blogs, etc.100% unique!
✅Create Ultra-HD graphics with a single keyword or phrase that commands 10x eyeballs!
✅Fully automated AI articles bulk generation!
✅Auto-post or schedule stunning AI content across all your accounts at once—WordPress, Facebook, LinkedIn, Blogger, and more.
✅With one keyword or URL, generate complete websites, landing pages, and more…
✅Automatically create & sell AI content, graphics, websites, landing pages, & all that gets you paid non-stop 24*7.
✅Pre-built High-Converting 100+ website Templates and 2000+ graphic templates logos, banners, and thumbnail images in Trending Niches.
✅Say goodbye to wasting time logging into multiple Chat GPT & AI Apps once & for all!
✅Save over $5000 per year and kick out dependency on third parties completely!
✅Brand New App: Not available anywhere else!
✅ Beginner-friendly!
✅ZERO upfront cost or any extra expenses
✅Risk-Free: 30-Day Money-Back Guarantee!
✅Commercial License included!
See My Other Reviews Article:
(1) AI Genie Review: https://sumonreview.com/ai-genie-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
#AIFusionBuddyReview,
#AIFusionBuddyFeatures,
#AIFusionBuddyPricing,
#AIFusionBuddyProsandCons,
#AIFusionBuddyTutorial,
#AIFusionBuddyUserExperience
#AIFusionBuddyforBeginners,
#AIFusionBuddyBenefits,
#AIFusionBuddyComparison,
#AIFusionBuddyInstallation,
#AIFusionBuddyRefundPolicy,
#AIFusionBuddyDemo,
#AIFusionBuddyMaintenanceFees,
#AIFusionBuddyNewbieFriendly,
#WhatIsAIFusionBuddy?,
#HowDoesAIFusionBuddyWorks
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Crescat
Crescat is industry-trusted event management software, built by event professionals for event professionals. Founded in 2017, we have three key products tailored for the live event industry.
Crescat Event for concert promoters and event agencies. Crescat Venue for music venues, conference centers, wedding venues, concert halls and more. And Crescat Festival for festivals, conferences and complex events.
With a wide range of popular features such as event scheduling, shift management, volunteer and crew coordination, artist booking and much more, Crescat is designed for customisation and ease-of-use.
Over 125,000 events have been planned in Crescat and with hundreds of customers of all shapes and sizes, from boutique event agencies through to international concert promoters, Crescat is rigged for success. What's more, we highly value feedback from our users and we are constantly improving our software with updates, new features and improvements.
If you plan events, run a venue or produce festivals and you're looking for ways to make your life easier, then we have a solution for you. Try our software for free or schedule a no-obligation demo with one of our product specialists today at crescat.io
Quarkus Hidden and Forbidden ExtensionsMax Andersen
Quarkus has a vast extension ecosystem and is known for its subsonic and subatomic feature set. Some of these features are not as well known, and some extensions are less talked about, but that does not make them less interesting - quite the opposite.
Come join this talk to see some tips and tricks for using Quarkus and some of the lesser known features, extensions and development techniques.
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
GraphSummit Paris - The art of the possible with Graph TechnologyNeo4j
Sudhir Hasbe, Chief Product Officer, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
3. Agenda
1. Ahead of Time Compilation
2. Lazy Loading
3. Change Detection
4. Memory Leaks
5. Server Side Rendering
4. Rangle Academy
Goal and Structure:
Program to share knowledge within the company
It follows a "workshop" structure
Usually 2 hours long
Covers hard and soft skills
Some workshops available:
Webpack
React
React Native
Google Analytics
Unit Testing
Introduction to Payment Gateways
Continuous Delivery to Production
Conflict Management
5. About the Demo App
Characteristics:
Built using Angular 2.4.1
Uses Angular CLI beta-26
Redux store with ngrx
Tachyons for CSS
Server side rendering with Angular Universal
All the numbers shown are based on:
Low end device (5x CPU slowdown)
Good 3G connection (Latency: 40ms, DL: 1.5 Mbps, UL: 750 Kbps)
7. Compilation Modes
Just in Time Compilation (JiT):
Compilation performed in the browser at run time
Bigger bundle size (includes the compiler)
Takes longer to boot the app
$ ng serve --prod
Ahead of Time Compilation (AoT):
Compilation performed in the server at build time
Smaller bundle size (doesn't include the compiler)
The app boots faster
$ ng serve --prod --aot
8.
9.
10. JiT vs AoT in Demo App (Prod + Gzip)
CSS files are included in the "other js files"
File Size (JiT) Size (AoT)
main.bundle.js 6.4 KB 23.9 KB
vendor.bundle.js 255 KB 158 KB
other js files 48.7 KB 49.6 KB
Total Download 306 KB 231.5 KB
AoT goals (from the ):docs
Faster rendering => Components already compiled
Fewer async request => Inline external HTML and CSS
Smaller bundle size => No compiler shipped
Detect template errors => Because they can
Better security => Prevents script injection attack
11. Boot Time Comparison
Event Time (JiT) Time (AoT)
DOM Content Loaded 5.44 s 3.25 s
Load 5.46 s 3.27 s
FMP 5.49 s 3.30 s
DOM Content Loaded:
The browser has finished parsing the DOM
jQuery nostalgia => $(document).ready()
Load: All the assets has been downloaded
First Meaningful Paint (FMP):
When the user is able to see the app "live" for the first time
(Show browser profile for both modes)
13. What is Lazy Loading?
Ability to load modules on demand => Useful to reduce the app startup time
(Compare branches no-lazy-loading vs normal-lazy-loading )
14. Bundle Sizes Comparison (Prod + AoT)
File Size (No LL) Size (LL)
main.bundle.js 23.9 KB 17.4 KB
vendor.bundle.js 158 KB 158 KB
other js files 49.6 KB 49.6 KB
Initial Download 231.5 KB 225 KB
0.chunk.js - 9.1 KB
Total Download 231.5 KB 234.1 KB
Webpack creates a "chunk" for every lazy loaded module
The file 0.chunk.js is loaded when the user navigates to admin
The initial download size is smaller with LL
The total size over time is bigger with LL because of Webpack async loading
The effect of LL start to be noticeable when the app grows
15. Boot Time Comparison (Prod + AoT)
Event Time (No LL) Time (LL)
DOM Content Loaded 3.25 s 3.11 s
Load 3.27 s 3.25 s
FMP 3.30 s 3.16 s
Not much difference for an small app
Just one lazy loaded module with a couple of components
The impact is noticeable for big apps
19. What's Change Detection (CD)?
It's a mechanism to keep our "models" in sync with our "views"
Change detection is fired when...
The user interacts with the app (click, submit, etc.)
An async event is completed (setTimeout, promise, observable)
When CD is fired, Angular will check every component starting from the top once.
20. Change Detection Strategy: OnPush
Angular offers 2 strategies:
Default: Check the entire component when CD is fired
OnPush: Check only relevant subtrees when CD is fired
OnPush Requirements:
Component inputs ( @Input ) need to be immutable objects
@Component({
selector: 'rio-workshop',
templateUrl: './workshop.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class WorkshopComponent {
@Input() workshop: Workshop;
@Input() isSummary = false;
}
View Example
24. Summary
What to do?
Apply the OnPush change detection on every component*
Never mutate an object or array, always create a a new reference ( )blog
// Don't
let addPerson = (person: Person): void => {
people.push(person);
};
// Do
let addPerson = (people: Person[], person: Person): Person[] => {
return [ ...people, person ];
};
Benefits:
Fewer checks of your components during Change Detection
Improved overall app performance
27. What Causes Memory Leaks in Angular?
Main Source => Subscriptions to observables never closed
@Injectable()
export class WorkshopService {
getAll(): Observable<Workshop[]> { ... }
}
@Component({
selector: 'rio-workshop-list',
template: `
<div *ngFor="let workshop of workshops">
{{ workshop.title }}
</div>`
})
export class WorkshopListComponent implements OnInit {
...
ngOnInit() {
this.service.getAll().subscribe(workshops => this.workshops = workshops);
}
}
28. Manually Closing Connections
Before the element is destroyed, close the connection
@Component({
selector: 'rio-workshop-list',
template: `
<div *ngFor="let workshop of workshops">
{{ workshop.title }}
</div>`
})
export class WorkshopListComponent implements OnInit, OnDestroy {
...
ngOnInit() {
this.subscription = this.service.getAll()
.subscribe(workshops => this.workshops = workshops);
}
ngOnDestroy() {
this.subscription.unsubscribe();
}
}
29. The async Pipe
It closes the connection automatically when the component is destroyed
@Component({
selector: 'rio-workshop-list',
template: `
<div *ngFor="let workshop of workshops$ | async">
{{ workshop.title }}
</div>`
})
export class WorkshopListComponent implements OnInit {
ngOnInit() {
this.workshops$ = this.service.getAll();
}
}
This is the recommended way of dealing with Observables in your template!
30. The Http Service
Every method of the http services ( get , post , etc.) returns an observable
Those observables emit only one value and the connection is closed automatically
They won't cause memory leak issues
@Component({
selector: 'rio-workshop-list',
template: `
<div *ngFor="let workshop of workshops">
{{ workshop.title }}
</div>`
})
export class WorkshopListComponent implements OnInit {
...
ngOnInit() {
this.http.get('some-url')
.map(data => data.json())
.subscribe(workshops => this.workshops = workshops);
}
}
31. Emit a Limited Number of Values
RxJs provides operators to close the connection automatically
Examples: first() and take(n)
This won't cause memory leak issues even if getAll emits multiple values
@Component({
selector: 'rio-workshop-list',
template: `
<div *ngFor="let workshop of workshops">
{{ workshop.title }}
</div>`
})
export class WorkshopListComponent implements OnInit {
ngOnInit() {
this.service.getAll().first()
.subscribe(workshops => this.workshops = workshops);
}
}
33. Angular Universal
Provides the ability to pre-render your application on the server
Much faster time to first paint
Enables better SEO
Enables content preview on social networks
Fallback support for older browsers
Use the as the base of your applicationuniversal-starter
34. What's Included
Suite of polyfills for the server
Server rendering layer
Preboot - replays your user's interactions after Angular has bootstrapped
State Rehydration - Don't lose your place when the application loads
35. Boot Time Comparison (Client vs Server)
Both environments include previous AoT and Lazy Loading enhancements
Event Time (Client) Time (Server)
DOM Content Loaded 3.11 s 411 ms
Load 3.25 s 2.88 s
FMP 3.16 s ~440 ms
*Times are on mobile over 3G
36. Universal Caveats
Cannot directly access the DOM
constructor(element: ElementRef, renderer: Renderer) {
renderer.setElementStyle(element.nativeElement, ‘font-size’, ‘x-large’);
}
Current solutions only cover Express and ASP.NET servers
Project will be migrated into the core Angular repo for v4
38. Performance Changes
Event JiT AoT Lazy Loading SSR
DOM Content Loaded 5.44 s 3.25 s 3.11 s 411 ms
Load 5.46 s 3.27 s 3.25 s 2.88 s
FMP 5.46 s 3.30 s 3.16 s ~440 ms
% Improvement (FMP) 39.6% 4.3% 86.1%
*Times are on mobile over 3G