SlideShare a Scribd company logo
Maximizing Lightning Experience
and Lightning Component
Performance
April 2, 2020 | 10:30 a.m. IST
Sr. Developer Evangelist Sr. Developer Evangelist
Aditya Naag Topalli Satya Sekhar
Image
Speakers
Image
Forward-Looking Statement
Statement under the Private Securities Litigation Reform Act of 1995:
This presentation contains forward-looking statements about the company’s financial and operating results, which may include expected GAAP and non-GAAP financial and other
operating and non-operating results, including revenue, net income, diluted earnings per share, operating cash flow growth, operating margin improvement, expected revenue
growth, expected current remaining performance obligation growth, expected tax rates, the one-time accounting non-cash charge that was incurred in connection with the
Salesforce.org combination; stock-based compensation expenses, amortization of purchased intangibles, shares outstanding, market growth and sustainability goals. The
achievement or success of the matters covered by such forward-looking statements involves risks, uncertainties and assumptions. If any such risks or uncertainties materialize or if
any of the assumptions prove incorrect, the company’s results could differ materially from the results expressed or implied by the forward-looking statements we make.
The risks and uncertainties referred to above include -- but are not limited to -- risks associated with the effect of general economic and market conditions; the impact of geopolitical
events; the impact of foreign currency exchange rate and interest rate fluctuations on our results; our business strategy and our plan to build our business, including our strategy to
be the leading provider of enterprise cloud computing applications and platforms; the pace of change and innovation in enterprise cloud computing services; the seasonal nature of
our sales cycles; the competitive nature of the market in which we participate; our international expansion strategy; the demands on our personnel and infrastructure resulting from
significant growth in our customer base and operations, including as a result of acquisitions; our service performance and security, including the resources and costs required to
avoid unanticipated downtime and prevent, detect and remediate potential security breaches; the expenses associated with new data centers and third-party infrastructure
providers; additional data center capacity; real estate and office facilities space; our operating results and cash flows; new services and product features, including any efforts to
expand our services beyond the CRM market; our strategy of acquiring or making investments in complementary businesses, joint ventures, services, technologies and intellectual
property rights; the performance and fair value of our investments in complementary businesses through our strategic investment portfolio; our ability to realize the benefits from
strategic partnerships, joint ventures and investments; the impact of future gains or losses from our strategic investment portfolio, including gains or losses from overall market
conditions that may affect the publicly traded companies within the company's strategic investment portfolio; our ability to execute our business plans; our ability to successfully
integrate acquired businesses and technologies, including delays related to the integration of Tableau due to regulatory review by the United Kingdom Competition and Markets
Authority; our ability to continue to grow unearned revenue and remaining performance obligation; our ability to protect our intellectual property rights; our ability to develop our
brands; our reliance on third-party hardware, software and platform providers; our dependency on the development and maintenance of the infrastructure of the Internet; the
effect of evolving domestic and foreign government regulations, including those related to the provision of services on the Internet, those related to accessing the Internet, and
those addressing data privacy, cross-border data transfers and import and export controls; the valuation of our deferred tax assets and the release of related valuation allowances;
the potential availability of additional tax assets in the future; the impact of new accounting pronouncements and tax laws; uncertainties affecting our ability to estimate our tax
rate; the impact of expensing stock options and other equity awards; the sufficiency of our capital resources; factors related to our outstanding debt, revolving credit facility, term
loan and loan associated with 50 Fremont; compliance with our debt covenants and lease obligations; current and potential litigation involving us; and the impact of climate change.
Further information on these and other factors that could affect the company’s financial results is included in the reports on Forms 10-K, 10-Q and 8-K and in other filings it makes
with the Securities and Exchange Commission from time to time. These documents are available on the SEC Filings section of the Investor Information section of the company’s
website at www.salesforce.com/investor.
Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements, except as required by law.
Follow us for updates
@salesforcedevs
Salesforce Developers
Salesforce Developers India
(t.me/salesforcedevsindia)
Salesforce Developers
This webinar is being recorded. The recording will be available on YouTube and will be sent via email.
Have Questions?
Don’t wait until the end to ask your question!
• Technical support will answer questions starting now.
Respect Q&A etiquette
• Please don’t repeat questions. The support team is working their way down the queue.
Stick around for live Q&A at the end
• Speakers will tackle more questions at the end, time-allowing
Head to Developer Forums
• More questions? Visit developer.salesforce.com/forums
As the global COVID-19 pandemic continues to impact us all, we hope that you’re
focusing on the health and safety of yourself and your families.
As we all continue to navigate this confusing time, we also want you to know that we’re
here for you.
Learn everything that Trailhead and Salesforce are doing to support our community in
these unprecedented times - https://bit.ly/33MIwNY
We’re here for you!
Is this our first remote webinar?
● How is Lightning different from Classic
● How to measure overall page performance
● 6 factors that affect overall page performance
○ Measurement Metrics
○ Tips to optimize
Agenda
We heard you loud and clear...
… that Lightning performance isn’t where it needs to be
The median time to load a
Lightning page is currently
1.4 seconds.
We are migrating many of the
core parts of the Lightning UI,
to LWC.
We’re investing heavily to
improve things going forward.
Source: Lightning Experience LEX - lightning speed please! - Ideas
An interesting analogy
Is Lightning Experience just a UI change?
SERVER
HTML rendered
on client
Classic Pages
Server driven
Server generates
HTML
Data Centers
Network
Data Protection
Monitoring
Storage
TRUST
Databases
Connectivity
Message Bus
Events
Metadata
SHARED SERVICES
& TOOLS
App Definition
Authorization
Provisioning
Authentication
Identity Resolution
DATA & EVENTSRUNTIMEAPP LAYER
Framework
SLDS
Navigation
Testing
Instrumentation Accessibility
Offline
LockerData
APP LAYER
Framework
SLDS
Navigation
Testing
Instrumentation Accessibility
Offline
LockerData
Page
Base
Components
Standard or
Custom
Components
Client App Layer
Framework
Testing
Instrumentation
SLDS
Navigation
Offline
Accessibility
Locker
Data
Lightning Pages
Component driven
Lightning Components Architecture
XHRs
XHR: XMLHttpRequest, used to transfer data between a web browser and a web server.
Ok, so LEX is not just a UI change...
● A lot of heavy lifting has been migrated from server to the client
○ Therefore, it is sensitive to browser & device performance.
● Lightning UI requires many XHRs to initially render a page
○ Therefore it is sensitive to network latency.
● Lightning UI is more dynamic & contains more components than Classic
○ Therefore pages with many custom fields and/or components are slower to render.
...but why does it seem slow?
Did you know?
Client side renderer application will ALWAYS be slower than server
side rendered pages regardless of the complexity.
Experiment time!
Let’s add a Visualforce Page to a page in Classic and
Lightning
Poll: Are you still using Visualforce?
Please answer the poll you see onscreen. The poll will be active for
30 seconds. Results will be shared after that.
How to measure Performance in LEX?
Experienced Page Time (EPT)
The time from when a
Page starts Loading
to the time when
No activity has occurred for at least two frames (about 33 ms)
Experienced Page Time (EPT)
0 1 432
1 3
2
4
4
Server Processing
Time (SPT)
Experienced Page Time (EPT)
LatencyLatency
Network Time
Browser Processing
Time (BPT)
Cached Data
Retrieval
How to measure EPT?
● Lightning Experience: Add an EPT counter to Lightning Experience.
○ Enable Debug mode
○ Add eptVisible=1 as a parameter to the Lightning URL.
● Lightning Usage App
○ Use app to view aggregated page and browser performance.
○ Build custom reports using Lightning Usage App objects.
● Event Monitoring: Use event types to monitor performance.
○ Lightning Page View, Lightning Interaction, Lightning Performance
Factors affecting EPT
Geographical Factors
and Network Latency
Device and client
capabilities
Salesforce Org
Configuration
Page Complexity Component Architecture Server Processing
Geographical Factors & Network Latency
Geographical Factors & Network Latency
How far are you from your host instance?
UK
Tokyo
Example: 125 ms Round Trip Time
TCP Connection Setup (1 RTT)
TLS Setup (2 RTT)
Open
Internet
VPN
~400ms
Geographical Factors & Network Latency
Salesforce continually expands and improves its infrastructure through:
● Horizontal and vertical scaling
● Application and database tuning
● Salesforce EDGE service, which boosts network performance
Continuous Improvement
Geographical Factors & Network Latency
It establishes network Edge PoPs (points of presence) all over the world and adding
high-bandwidth, persistent, secure connections between our data centers.
Salesforce EDGE service
Geographical Factors & Network Latency
Salesforce EDGE service
Refer to What is Salesforce Edge? for more details
● TLS Termination: Secure handshake in shorter time
● Caching static content: Cacheable objects stored in locations closer to customer in a
compliant manner
● Route Optimization: Uses latency measurements & topology to direct customers to the
best EDGE.
● ML Driven network optimizations: Congestion Control
Geographical Factors & Network Latency
Measure
● Ask your IT department to run a “ping” or “traceroute”.
● Run the Salesforce Performance test - https://yourdomain.lightning.force.com/speedtest.jsp
Recommended metrics
● Latency of 150 ms or lower.
● Download speed of 3 Mbps or higher.
Geographical Factors & Network Latency
Optimize
● Enable Content Delivery Network for Lightning Component Framework
○ Uses Akamai’s CDN for static JavaScript and CSS.
○ Doesn’t distribute your org’s data or metadata in a CDN.
○ Serves requests for the following from 'static.<instance>.salesforce.com'
● Refactor components to reduce XHRs.
Geographical Factors & Network Latency
Optimize
Without CDN
With CDN
Geographical Factors & Network Latency
Which option is right for me?
My Domain enabled orgs
with global users
Static Lightning
Components
● For publicly cacheable
resources
● With Salesforce CDN
partner or any preferred
CDN vendor
● Customers with limited
network egress for security
and compliance
● Private connection from
your DC to the Salesforce
infrastructure
Salesforce Edge
Lightning CDN
Communities CDN Express Connect
Device and Browser Capability
Device and Browser Capability
● The browser relies on the device’s available resources, such as processing power, memory,
and even hard disk performance, to execute JavaScript and optimize rendering.
● Memory and CPU cycles are consumed when
○ Using web browsers with plug-ins or extensions
○ Running too many browser tabs simultaneously
Resource availability is critical
Device and Browser Capability
● Metric used is Octane score
● Run the Salesforce Performance test -
https://yourDomain.lightning.force.com/speedtest.jsp
Measure
Recommended metrics
● Octane score of 30000
● 8 GB RAM with 3 GB to browser
Device and Browser Capability
For the fastest and most stable experience
Minimum Recommended
Octane Score 20,000 30,000
RAM 5 GB with 2 GB available to
browser
8 GB with 3 GB available to
browser
Network Latency 200ms or lower 150ms or lower
Download Speed > 1Mbps > 3Mbps
The minimum requirements result in 50% slower page load times
Device and Browser Capability
● Device
○ Ensure laptops are fully charged or connected to a power source.
○ Close other applications running on the client device, if possible.
○ Upgrade the client device to a model with more processing power and memory.
○ Restart ;)
● Browser
○ Reset browser settings to original defaults, if possible.
○ Remove or disable unused or unnecessary browser plugins and extensions.
○ Use latest browser version or patch.
○ Switch browsers: Performance varies by browser.
Optimize
Org Configuration
Org Configuration
● Disable Debug Mode
● Enable Secure and Persistent Browser Caching
● Enable Progressive rendering on communities
● Limit # of Open tabs in Console Apps
A few settings to remember
Org Configuration
● Scrolling performance degrades based on the number of rows in the page.
List View Performance
∝ Time spent
recalculating styles
Number of HTML
elements
Number of rows and
columns ∝
● How HTML elements are drawn and managed is dependent on the browser.
Org Configuration
Optimize List View Performance
● Don’t use a list view to scroll through large volume of content
○ Use a search bar
○ Use filters. e.g. Picklists, Owners, Date Range etc.
○ Use Reports
● Reduce the number of columns displayed
● Disable inline editing, if needed
● Disable Smooth Scrolling and Threaded Scrolling in Chrome, if needed
Page Complexity
Page Complexity
● Everything you do affects performance.
● Components added to a page are instantiated when the page is loaded.
● Performance suffers if a page has
○ Large number of fields
○ Large number of “visible” components
○ Inefficient custom components
○ Complex page configurations
What makes a page complex?
Page Complexity
● Utilize Lazy instantiation in Lightning Experience.
● The below areas of Lightning Experience are lazily instantiated:
○ Quick or Global Actions
○ Utility Bar
○ App Builder tabs
● Use Base Lightning Components in custom components for Lazy instantiation
Optimize
Page Complexity
● Break up the elements on pages into App Builder tabs.
○ Present the most-needed information on the first tab
○ Move less critical components behind one or more Lightning page tabs.
● Details Component
○ Reduce number of fields on the layout (less than 50 recommended). This has a linear impact
on rendering time.
○ Recommendation: Place in a secondary tab
Optimize
Page Complexity
● Related Lists
○ Reduce related lists (to less than 12)
○ Use Related List Single component for the most important object
○ Hide remaining related lists behind a secondary tab
● Custom Components
○ Use Lightning Actions instead of custom components where appropriate.
○ Optimize custom component performance and use LWC framework.
● Optimize for mobile
Optimize
Page Complexity
Optimize
Component Architecture
Component Architecture
● Use Chrome Developer Tools Performance timeline to drill down into each operation in
the rendering pipeline
● Use the Lightning Inspector Chrome plugin (For Aura)
● Chrome Code Coverage Report for JS.
Measure
Component Architecture
● Use if:true and if:false directives in LWC, or <aura:if> in Aura for conditional rendering
which helps you avoid:
○ CSS toggling - Creates and renders components that aren’t used.
○ Using JS for dom manipulation - It is expensive.
○ High number of HTML elements - Slows the page down, and impacts style recalculations
● To conditionally render a large number of components in Aura, use dynamic component
creation as JS is faster.
Optimize: Conditional Rendering
Component Architecture
● Clean Unrendered Body
Occurs when you change the isTrue/if:true from true to false in the same rendering cycle.
The unrendered body must be destroyed, which is avoidable work for the framework that
slows down rendering time.
● Multiple Items Set
Occurs when you set the items attribute of an <aura:iteration> or <template for:each>
multiple times in the same rendering cycle.
Optimize: Fix Performance Warnings in Aura
Component Architecture
● Use caching features wherever possible
○ Lightning Data Service
○ Wire Decorators
○ Platform Cache
● Use Lazy Instantiation
○ Avoid creating components until the user clicks for them.
○ Use Pagination and Tabbed approach
○ Base Lightning Components like <lightning-tabset> and <lightning-tab> support lazy
instantiation by default.
● Remove unused CSS, Avoid Complex selectors
Optimize: A few tips
Component Architecture
● Reduce Lightning Out dependencies
○ As a best practice only include top level components and expensive-to-create components.
○ Don’t list the ones in lightning namespace
● Optimize images for mobile
●
Optimize: A few tips
Component Architecture
● Use IFRAMEs sparingly
○ An iframe can block Lightning Component loading
○ Browser opens 6 connections for resources. iframes can hold many of them
● Minimize frequent navigation
○ Navigation makes components and pages reload
○ Include user-needed data as components
● Migrate component trees to LWC
Optimize: A few tips
Component Architecture
Optimize: Migrate to Lightning Web Components
LWC
Aura
Component Architecture
Optimize: Lightning Web Components Case Study
Read more: Case Study: DreamHouse Gains Speed by Switching to LWC
Component Architecture
Optimize: Feel free to report issues
Poll: How many of the tools discussed
today do you already use?
Please answer the poll you see onscreen. The poll will be active for
30 seconds. Results will be shared after that.
Further Learning
Sample Gallery
Reference Code and Best Practices for Salesforce Developers
April 23 2020, 10:30 a.m. IST
Upcoming Webinar
RSVP now
Q&A
Try Trailhead: trailhead.salesforce.com
Join the conversation on Facebook: @salesforcedevs
Subscribe to our Telegram Channel: t.me/salesforcedevsindia
Survey
Your feedback is crucial to the success of our
webinar programs. Please fill out the survey at
the end of the webinar. Thank you!
Maximizing Salesforce Lightning Experience and Lightning Component Performance

More Related Content

What's hot (20)

PDF
Choosing the Right Demo Environment (Salesforce Partners)
Salesforce Partners
 
PPTX
Quick Start to Field Service Lightning, Paweł Dobrzynski
CzechDreamin
 
PDF
Two-Way Integration with Writable External Objects
Salesforce Developers
 
PPTX
Case Study: Salesforce CPQ (Configure Price Quote) for Software as a Service ...
Jade Global
 
PDF
Getting started with Salesforce security
Salesforce Admins
 
PDF
A Comprehensive Guide to Salesforce Field Service
Cloud Analogy
 
PPTX
Data model in salesforce
Chamil Madusanka
 
PPTX
Master data management (mdm) & plm in context of enterprise product management
Tata Consultancy Services
 
PPTX
Salesforce Overview For Beginners/Students
Sujesh Ramachandran
 
PDF
Application Lifecycle Management (ALM).pdf
Amitesh Raikwar
 
PDF
Salesforce Interview Questions And Answers | Salesforce Tutorial | Salesforce...
Edureka!
 
PPTX
Force.com Data Modeling: The Advantages of Denormalization
Salesforce Developers
 
PDF
CPQ Solution Study
Demand Metric
 
PPTX
Salesforce CPQ Online Training
Prasannakumar898
 
PDF
From Sandbox To Production: An Introduction to Salesforce Release Management
Salesforce Developers
 
PPTX
What's New in Oracle EPM Cloud
Perficient, Inc.
 
PDF
Business Process Mapping for Salesforce Admins
Salesforce Admins
 
PPTX
Understanding Multitenancy and the Architecture of the Salesforce Platform
Salesforce Developers
 
PPTX
Episode 10 - External Services in Salesforce
Jitendra Zaa
 
PPT
Salesforce Data Structures
Idealist Consulting
 
Choosing the Right Demo Environment (Salesforce Partners)
Salesforce Partners
 
Quick Start to Field Service Lightning, Paweł Dobrzynski
CzechDreamin
 
Two-Way Integration with Writable External Objects
Salesforce Developers
 
Case Study: Salesforce CPQ (Configure Price Quote) for Software as a Service ...
Jade Global
 
Getting started with Salesforce security
Salesforce Admins
 
A Comprehensive Guide to Salesforce Field Service
Cloud Analogy
 
Data model in salesforce
Chamil Madusanka
 
Master data management (mdm) & plm in context of enterprise product management
Tata Consultancy Services
 
Salesforce Overview For Beginners/Students
Sujesh Ramachandran
 
Application Lifecycle Management (ALM).pdf
Amitesh Raikwar
 
Salesforce Interview Questions And Answers | Salesforce Tutorial | Salesforce...
Edureka!
 
Force.com Data Modeling: The Advantages of Denormalization
Salesforce Developers
 
CPQ Solution Study
Demand Metric
 
Salesforce CPQ Online Training
Prasannakumar898
 
From Sandbox To Production: An Introduction to Salesforce Release Management
Salesforce Developers
 
What's New in Oracle EPM Cloud
Perficient, Inc.
 
Business Process Mapping for Salesforce Admins
Salesforce Admins
 
Understanding Multitenancy and the Architecture of the Salesforce Platform
Salesforce Developers
 
Episode 10 - External Services in Salesforce
Jitendra Zaa
 
Salesforce Data Structures
Idealist Consulting
 

Similar to Maximizing Salesforce Lightning Experience and Lightning Component Performance (20)

PPTX
Stamford developer group - 8 easy steps to master in lightning web components
Amol Dixit
 
PPTX
Summer 23 LWC Updates + Slack Apps.pptx
Kishore B T
 
PDF
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Salesforce Developers
 
PDF
Local development with Open Source Base Components
Salesforce Developers
 
PDF
Salesforce Spring'20 Features
Bordeaux Salesforce Developer Group
 
PPTX
Lightning Updates: Summer, Winter & Beyond
Salesforce Developers
 
PPTX
Building apps faster with lightning and winter '17
Salesforce Developers
 
PPTX
Building Apps Faster with Lightning and Winter '17
Mark Adcock
 
PPTX
Spring '19 Release-in-a-Box
Marc Lester
 
PPTX
Build Better Communities with Lightning
Salesforce Developers
 
PPTX
TrailheaDX India : Developer Highlights
Salesforce Developers
 
PDF
Lightning Components 101: An Apex Developer's Guide
Adam Olshansky
 
PDF
Summer '20 Release Overview
Bordeaux Salesforce Developer Group
 
PDF
アドバンスドLightningコンポーネント:品質の高いコンポーネント開発のためのTips
Salesforce Developers Japan
 
PPSX
Make the jump to lightning and get it right first time
Michael Gill
 
PPTX
Webinar: Build Apps Customers Love as a Salesforce Developer
Salesforce Developers
 
PPTX
Lightning Productivity Features.pptx
JessicaTestes
 
PDF
Einstein Analytics for Developers
Salesforce Developers
 
PPTX
Winter'18 Developer Preview Webinar
Salesforce Developers
 
PPTX
Summer '20 preview release overview-deck
Alan Thomas Payne
 
Stamford developer group - 8 easy steps to master in lightning web components
Amol Dixit
 
Summer 23 LWC Updates + Slack Apps.pptx
Kishore B T
 
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Salesforce Developers
 
Local development with Open Source Base Components
Salesforce Developers
 
Salesforce Spring'20 Features
Bordeaux Salesforce Developer Group
 
Lightning Updates: Summer, Winter & Beyond
Salesforce Developers
 
Building apps faster with lightning and winter '17
Salesforce Developers
 
Building Apps Faster with Lightning and Winter '17
Mark Adcock
 
Spring '19 Release-in-a-Box
Marc Lester
 
Build Better Communities with Lightning
Salesforce Developers
 
TrailheaDX India : Developer Highlights
Salesforce Developers
 
Lightning Components 101: An Apex Developer's Guide
Adam Olshansky
 
Summer '20 Release Overview
Bordeaux Salesforce Developer Group
 
アドバンスドLightningコンポーネント:品質の高いコンポーネント開発のためのTips
Salesforce Developers Japan
 
Make the jump to lightning and get it right first time
Michael Gill
 
Webinar: Build Apps Customers Love as a Salesforce Developer
Salesforce Developers
 
Lightning Productivity Features.pptx
JessicaTestes
 
Einstein Analytics for Developers
Salesforce Developers
 
Winter'18 Developer Preview Webinar
Salesforce Developers
 
Summer '20 preview release overview-deck
Alan Thomas Payne
 
Ad

More from Salesforce Developers (20)

PDF
Why developers shouldn’t miss TrailheaDX India
Salesforce Developers
 
PPTX
CodeLive: Build Lightning Web Components faster with Local Development
Salesforce Developers
 
PPTX
CodeLive: Converting Aura Components to Lightning Web Components
Salesforce Developers
 
PPTX
Enterprise-grade UI with open source Lightning Web Components
Salesforce Developers
 
PPTX
TrailheaDX and Summer '19: Developer Highlights
Salesforce Developers
 
PDF
Live coding with LWC
Salesforce Developers
 
PDF
Lightning web components - Episode 4 : Security and Testing
Salesforce Developers
 
PDF
LWC Episode 3- Component Communication and Aura Interoperability
Salesforce Developers
 
PDF
Lightning web components episode 2- work with salesforce data
Salesforce Developers
 
PDF
Lightning web components - Episode 1 - An Introduction
Salesforce Developers
 
PDF
Migrating CPQ to Advanced Calculator and JSQCP
Salesforce Developers
 
PDF
Scale with Large Data Volumes and Big Objects in Salesforce
Salesforce Developers
 
PDF
Replicate Salesforce Data in Real Time with Change Data Capture
Salesforce Developers
 
PDF
Modern Development with Salesforce DX
Salesforce Developers
 
PDF
Get Into Lightning Flow Development
Salesforce Developers
 
PDF
Integrate CMS Content Into Lightning Communities with CMS Connect
Salesforce Developers
 
PDF
Introduction to MuleSoft
Salesforce Developers
 
PDF
Modern App Dev: Modular Development Strategies
Salesforce Developers
 
PPTX
Dreamforce Developer Recap
Salesforce Developers
 
PDF
Vs Code for Salesforce Developers
Salesforce Developers
 
Why developers shouldn’t miss TrailheaDX India
Salesforce Developers
 
CodeLive: Build Lightning Web Components faster with Local Development
Salesforce Developers
 
CodeLive: Converting Aura Components to Lightning Web Components
Salesforce Developers
 
Enterprise-grade UI with open source Lightning Web Components
Salesforce Developers
 
TrailheaDX and Summer '19: Developer Highlights
Salesforce Developers
 
Live coding with LWC
Salesforce Developers
 
Lightning web components - Episode 4 : Security and Testing
Salesforce Developers
 
LWC Episode 3- Component Communication and Aura Interoperability
Salesforce Developers
 
Lightning web components episode 2- work with salesforce data
Salesforce Developers
 
Lightning web components - Episode 1 - An Introduction
Salesforce Developers
 
Migrating CPQ to Advanced Calculator and JSQCP
Salesforce Developers
 
Scale with Large Data Volumes and Big Objects in Salesforce
Salesforce Developers
 
Replicate Salesforce Data in Real Time with Change Data Capture
Salesforce Developers
 
Modern Development with Salesforce DX
Salesforce Developers
 
Get Into Lightning Flow Development
Salesforce Developers
 
Integrate CMS Content Into Lightning Communities with CMS Connect
Salesforce Developers
 
Introduction to MuleSoft
Salesforce Developers
 
Modern App Dev: Modular Development Strategies
Salesforce Developers
 
Dreamforce Developer Recap
Salesforce Developers
 
Vs Code for Salesforce Developers
Salesforce Developers
 
Ad

Recently uploaded (20)

PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 

Maximizing Salesforce Lightning Experience and Lightning Component Performance

  • 1. Maximizing Lightning Experience and Lightning Component Performance April 2, 2020 | 10:30 a.m. IST
  • 2. Sr. Developer Evangelist Sr. Developer Evangelist Aditya Naag Topalli Satya Sekhar Image Speakers Image
  • 3. Forward-Looking Statement Statement under the Private Securities Litigation Reform Act of 1995: This presentation contains forward-looking statements about the company’s financial and operating results, which may include expected GAAP and non-GAAP financial and other operating and non-operating results, including revenue, net income, diluted earnings per share, operating cash flow growth, operating margin improvement, expected revenue growth, expected current remaining performance obligation growth, expected tax rates, the one-time accounting non-cash charge that was incurred in connection with the Salesforce.org combination; stock-based compensation expenses, amortization of purchased intangibles, shares outstanding, market growth and sustainability goals. The achievement or success of the matters covered by such forward-looking statements involves risks, uncertainties and assumptions. If any such risks or uncertainties materialize or if any of the assumptions prove incorrect, the company’s results could differ materially from the results expressed or implied by the forward-looking statements we make. The risks and uncertainties referred to above include -- but are not limited to -- risks associated with the effect of general economic and market conditions; the impact of geopolitical events; the impact of foreign currency exchange rate and interest rate fluctuations on our results; our business strategy and our plan to build our business, including our strategy to be the leading provider of enterprise cloud computing applications and platforms; the pace of change and innovation in enterprise cloud computing services; the seasonal nature of our sales cycles; the competitive nature of the market in which we participate; our international expansion strategy; the demands on our personnel and infrastructure resulting from significant growth in our customer base and operations, including as a result of acquisitions; our service performance and security, including the resources and costs required to avoid unanticipated downtime and prevent, detect and remediate potential security breaches; the expenses associated with new data centers and third-party infrastructure providers; additional data center capacity; real estate and office facilities space; our operating results and cash flows; new services and product features, including any efforts to expand our services beyond the CRM market; our strategy of acquiring or making investments in complementary businesses, joint ventures, services, technologies and intellectual property rights; the performance and fair value of our investments in complementary businesses through our strategic investment portfolio; our ability to realize the benefits from strategic partnerships, joint ventures and investments; the impact of future gains or losses from our strategic investment portfolio, including gains or losses from overall market conditions that may affect the publicly traded companies within the company's strategic investment portfolio; our ability to execute our business plans; our ability to successfully integrate acquired businesses and technologies, including delays related to the integration of Tableau due to regulatory review by the United Kingdom Competition and Markets Authority; our ability to continue to grow unearned revenue and remaining performance obligation; our ability to protect our intellectual property rights; our ability to develop our brands; our reliance on third-party hardware, software and platform providers; our dependency on the development and maintenance of the infrastructure of the Internet; the effect of evolving domestic and foreign government regulations, including those related to the provision of services on the Internet, those related to accessing the Internet, and those addressing data privacy, cross-border data transfers and import and export controls; the valuation of our deferred tax assets and the release of related valuation allowances; the potential availability of additional tax assets in the future; the impact of new accounting pronouncements and tax laws; uncertainties affecting our ability to estimate our tax rate; the impact of expensing stock options and other equity awards; the sufficiency of our capital resources; factors related to our outstanding debt, revolving credit facility, term loan and loan associated with 50 Fremont; compliance with our debt covenants and lease obligations; current and potential litigation involving us; and the impact of climate change. Further information on these and other factors that could affect the company’s financial results is included in the reports on Forms 10-K, 10-Q and 8-K and in other filings it makes with the Securities and Exchange Commission from time to time. These documents are available on the SEC Filings section of the Investor Information section of the company’s website at www.salesforce.com/investor. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements, except as required by law.
  • 4. Follow us for updates @salesforcedevs Salesforce Developers Salesforce Developers India (t.me/salesforcedevsindia) Salesforce Developers This webinar is being recorded. The recording will be available on YouTube and will be sent via email.
  • 5. Have Questions? Don’t wait until the end to ask your question! • Technical support will answer questions starting now. Respect Q&A etiquette • Please don’t repeat questions. The support team is working their way down the queue. Stick around for live Q&A at the end • Speakers will tackle more questions at the end, time-allowing Head to Developer Forums • More questions? Visit developer.salesforce.com/forums
  • 6. As the global COVID-19 pandemic continues to impact us all, we hope that you’re focusing on the health and safety of yourself and your families. As we all continue to navigate this confusing time, we also want you to know that we’re here for you. Learn everything that Trailhead and Salesforce are doing to support our community in these unprecedented times - https://bit.ly/33MIwNY We’re here for you!
  • 7. Is this our first remote webinar?
  • 8. ● How is Lightning different from Classic ● How to measure overall page performance ● 6 factors that affect overall page performance ○ Measurement Metrics ○ Tips to optimize Agenda
  • 9. We heard you loud and clear... … that Lightning performance isn’t where it needs to be The median time to load a Lightning page is currently 1.4 seconds. We are migrating many of the core parts of the Lightning UI, to LWC. We’re investing heavily to improve things going forward. Source: Lightning Experience LEX - lightning speed please! - Ideas
  • 11. Is Lightning Experience just a UI change?
  • 12. SERVER HTML rendered on client Classic Pages Server driven Server generates HTML
  • 13. Data Centers Network Data Protection Monitoring Storage TRUST Databases Connectivity Message Bus Events Metadata SHARED SERVICES & TOOLS App Definition Authorization Provisioning Authentication Identity Resolution DATA & EVENTSRUNTIMEAPP LAYER Framework SLDS Navigation Testing Instrumentation Accessibility Offline LockerData APP LAYER Framework SLDS Navigation Testing Instrumentation Accessibility Offline LockerData Page Base Components Standard or Custom Components Client App Layer Framework Testing Instrumentation SLDS Navigation Offline Accessibility Locker Data Lightning Pages Component driven
  • 14. Lightning Components Architecture XHRs XHR: XMLHttpRequest, used to transfer data between a web browser and a web server.
  • 15. Ok, so LEX is not just a UI change... ● A lot of heavy lifting has been migrated from server to the client ○ Therefore, it is sensitive to browser & device performance. ● Lightning UI requires many XHRs to initially render a page ○ Therefore it is sensitive to network latency. ● Lightning UI is more dynamic & contains more components than Classic ○ Therefore pages with many custom fields and/or components are slower to render. ...but why does it seem slow? Did you know? Client side renderer application will ALWAYS be slower than server side rendered pages regardless of the complexity.
  • 16. Experiment time! Let’s add a Visualforce Page to a page in Classic and Lightning
  • 17. Poll: Are you still using Visualforce? Please answer the poll you see onscreen. The poll will be active for 30 seconds. Results will be shared after that.
  • 18. How to measure Performance in LEX?
  • 19. Experienced Page Time (EPT) The time from when a Page starts Loading to the time when No activity has occurred for at least two frames (about 33 ms)
  • 20. Experienced Page Time (EPT) 0 1 432 1 3 2 4 4 Server Processing Time (SPT) Experienced Page Time (EPT) LatencyLatency Network Time Browser Processing Time (BPT) Cached Data Retrieval
  • 21. How to measure EPT? ● Lightning Experience: Add an EPT counter to Lightning Experience. ○ Enable Debug mode ○ Add eptVisible=1 as a parameter to the Lightning URL. ● Lightning Usage App ○ Use app to view aggregated page and browser performance. ○ Build custom reports using Lightning Usage App objects. ● Event Monitoring: Use event types to monitor performance. ○ Lightning Page View, Lightning Interaction, Lightning Performance
  • 22. Factors affecting EPT Geographical Factors and Network Latency Device and client capabilities Salesforce Org Configuration Page Complexity Component Architecture Server Processing
  • 23. Geographical Factors & Network Latency
  • 24. Geographical Factors & Network Latency How far are you from your host instance? UK Tokyo Example: 125 ms Round Trip Time TCP Connection Setup (1 RTT) TLS Setup (2 RTT) Open Internet VPN ~400ms
  • 25. Geographical Factors & Network Latency Salesforce continually expands and improves its infrastructure through: ● Horizontal and vertical scaling ● Application and database tuning ● Salesforce EDGE service, which boosts network performance Continuous Improvement
  • 26. Geographical Factors & Network Latency It establishes network Edge PoPs (points of presence) all over the world and adding high-bandwidth, persistent, secure connections between our data centers. Salesforce EDGE service
  • 27. Geographical Factors & Network Latency Salesforce EDGE service Refer to What is Salesforce Edge? for more details ● TLS Termination: Secure handshake in shorter time ● Caching static content: Cacheable objects stored in locations closer to customer in a compliant manner ● Route Optimization: Uses latency measurements & topology to direct customers to the best EDGE. ● ML Driven network optimizations: Congestion Control
  • 28. Geographical Factors & Network Latency Measure ● Ask your IT department to run a “ping” or “traceroute”. ● Run the Salesforce Performance test - https://yourdomain.lightning.force.com/speedtest.jsp Recommended metrics ● Latency of 150 ms or lower. ● Download speed of 3 Mbps or higher.
  • 29. Geographical Factors & Network Latency Optimize ● Enable Content Delivery Network for Lightning Component Framework ○ Uses Akamai’s CDN for static JavaScript and CSS. ○ Doesn’t distribute your org’s data or metadata in a CDN. ○ Serves requests for the following from 'static.<instance>.salesforce.com' ● Refactor components to reduce XHRs.
  • 30. Geographical Factors & Network Latency Optimize Without CDN With CDN
  • 31. Geographical Factors & Network Latency Which option is right for me? My Domain enabled orgs with global users Static Lightning Components ● For publicly cacheable resources ● With Salesforce CDN partner or any preferred CDN vendor ● Customers with limited network egress for security and compliance ● Private connection from your DC to the Salesforce infrastructure Salesforce Edge Lightning CDN Communities CDN Express Connect
  • 32. Device and Browser Capability
  • 33. Device and Browser Capability ● The browser relies on the device’s available resources, such as processing power, memory, and even hard disk performance, to execute JavaScript and optimize rendering. ● Memory and CPU cycles are consumed when ○ Using web browsers with plug-ins or extensions ○ Running too many browser tabs simultaneously Resource availability is critical
  • 34. Device and Browser Capability ● Metric used is Octane score ● Run the Salesforce Performance test - https://yourDomain.lightning.force.com/speedtest.jsp Measure Recommended metrics ● Octane score of 30000 ● 8 GB RAM with 3 GB to browser
  • 35. Device and Browser Capability For the fastest and most stable experience Minimum Recommended Octane Score 20,000 30,000 RAM 5 GB with 2 GB available to browser 8 GB with 3 GB available to browser Network Latency 200ms or lower 150ms or lower Download Speed > 1Mbps > 3Mbps The minimum requirements result in 50% slower page load times
  • 36. Device and Browser Capability ● Device ○ Ensure laptops are fully charged or connected to a power source. ○ Close other applications running on the client device, if possible. ○ Upgrade the client device to a model with more processing power and memory. ○ Restart ;) ● Browser ○ Reset browser settings to original defaults, if possible. ○ Remove or disable unused or unnecessary browser plugins and extensions. ○ Use latest browser version or patch. ○ Switch browsers: Performance varies by browser. Optimize
  • 38. Org Configuration ● Disable Debug Mode ● Enable Secure and Persistent Browser Caching ● Enable Progressive rendering on communities ● Limit # of Open tabs in Console Apps A few settings to remember
  • 39. Org Configuration ● Scrolling performance degrades based on the number of rows in the page. List View Performance ∝ Time spent recalculating styles Number of HTML elements Number of rows and columns ∝ ● How HTML elements are drawn and managed is dependent on the browser.
  • 40. Org Configuration Optimize List View Performance ● Don’t use a list view to scroll through large volume of content ○ Use a search bar ○ Use filters. e.g. Picklists, Owners, Date Range etc. ○ Use Reports ● Reduce the number of columns displayed ● Disable inline editing, if needed ● Disable Smooth Scrolling and Threaded Scrolling in Chrome, if needed
  • 42. Page Complexity ● Everything you do affects performance. ● Components added to a page are instantiated when the page is loaded. ● Performance suffers if a page has ○ Large number of fields ○ Large number of “visible” components ○ Inefficient custom components ○ Complex page configurations What makes a page complex?
  • 43. Page Complexity ● Utilize Lazy instantiation in Lightning Experience. ● The below areas of Lightning Experience are lazily instantiated: ○ Quick or Global Actions ○ Utility Bar ○ App Builder tabs ● Use Base Lightning Components in custom components for Lazy instantiation Optimize
  • 44. Page Complexity ● Break up the elements on pages into App Builder tabs. ○ Present the most-needed information on the first tab ○ Move less critical components behind one or more Lightning page tabs. ● Details Component ○ Reduce number of fields on the layout (less than 50 recommended). This has a linear impact on rendering time. ○ Recommendation: Place in a secondary tab Optimize
  • 45. Page Complexity ● Related Lists ○ Reduce related lists (to less than 12) ○ Use Related List Single component for the most important object ○ Hide remaining related lists behind a secondary tab ● Custom Components ○ Use Lightning Actions instead of custom components where appropriate. ○ Optimize custom component performance and use LWC framework. ● Optimize for mobile Optimize
  • 48. Component Architecture ● Use Chrome Developer Tools Performance timeline to drill down into each operation in the rendering pipeline ● Use the Lightning Inspector Chrome plugin (For Aura) ● Chrome Code Coverage Report for JS. Measure
  • 49. Component Architecture ● Use if:true and if:false directives in LWC, or <aura:if> in Aura for conditional rendering which helps you avoid: ○ CSS toggling - Creates and renders components that aren’t used. ○ Using JS for dom manipulation - It is expensive. ○ High number of HTML elements - Slows the page down, and impacts style recalculations ● To conditionally render a large number of components in Aura, use dynamic component creation as JS is faster. Optimize: Conditional Rendering
  • 50. Component Architecture ● Clean Unrendered Body Occurs when you change the isTrue/if:true from true to false in the same rendering cycle. The unrendered body must be destroyed, which is avoidable work for the framework that slows down rendering time. ● Multiple Items Set Occurs when you set the items attribute of an <aura:iteration> or <template for:each> multiple times in the same rendering cycle. Optimize: Fix Performance Warnings in Aura
  • 51. Component Architecture ● Use caching features wherever possible ○ Lightning Data Service ○ Wire Decorators ○ Platform Cache ● Use Lazy Instantiation ○ Avoid creating components until the user clicks for them. ○ Use Pagination and Tabbed approach ○ Base Lightning Components like <lightning-tabset> and <lightning-tab> support lazy instantiation by default. ● Remove unused CSS, Avoid Complex selectors Optimize: A few tips
  • 52. Component Architecture ● Reduce Lightning Out dependencies ○ As a best practice only include top level components and expensive-to-create components. ○ Don’t list the ones in lightning namespace ● Optimize images for mobile ● Optimize: A few tips
  • 53. Component Architecture ● Use IFRAMEs sparingly ○ An iframe can block Lightning Component loading ○ Browser opens 6 connections for resources. iframes can hold many of them ● Minimize frequent navigation ○ Navigation makes components and pages reload ○ Include user-needed data as components ● Migrate component trees to LWC Optimize: A few tips
  • 54. Component Architecture Optimize: Migrate to Lightning Web Components LWC Aura
  • 55. Component Architecture Optimize: Lightning Web Components Case Study Read more: Case Study: DreamHouse Gains Speed by Switching to LWC
  • 56. Component Architecture Optimize: Feel free to report issues
  • 57. Poll: How many of the tools discussed today do you already use? Please answer the poll you see onscreen. The poll will be active for 30 seconds. Results will be shared after that.
  • 59. Sample Gallery Reference Code and Best Practices for Salesforce Developers April 23 2020, 10:30 a.m. IST Upcoming Webinar RSVP now
  • 60. Q&A Try Trailhead: trailhead.salesforce.com Join the conversation on Facebook: @salesforcedevs Subscribe to our Telegram Channel: t.me/salesforcedevsindia
  • 61. Survey Your feedback is crucial to the success of our webinar programs. Please fill out the survey at the end of the webinar. Thank you!