SlideShare a Scribd company logo
1 of 31
Download to read offline
Performance & Memory Tuning - Part I
How This Module Is Structured
© Codename One 2017 all rights reserved
✦Performance Tips
How This Module Is Structured
© Codename One 2017 all rights reserved
✦Performance Tips
✦Root causes (profiling)
How This Module Is Structured
© Codename One 2017 all rights reserved
✦Performance Tips
✦Root causes (profiling)
✦Real World Example
What is Performance?
© Codename One 2017 all rights reserved
What is Performance?
© Codename One 2017 all rights reserved
✦Rendering Performance
✦Logic Performance
✦Memory Thrashing & Crashes
✦Perceived Performance
✦Pareto distribution
Rendering Performance
© Codename One 2017 all rights reserved
✦Framerate
Rendering Performance
© Codename One 2017 all rights reserved
✦Framerate
✦Feels less smooth
Rendering Performance
© Codename One 2017 all rights reserved
✦Framerate
✦Feels less smooth
✦Animations & scrolling feel jumpy
Rendering Performance
© Codename One 2017 all rights reserved
✦Framerate
✦Feels less smooth
✦Animations & scrolling feel jumpy
✦Small issues
Rendering Performance
© Codename One 2017 all rights reserved
✦Framerate
✦Feels less smooth
✦Animations & scrolling feel jumpy
✦Small issues
✦Need to render a frame within 16 milliseconds for 60fps
Logic Performance
© Codename One 2017 all rights reserved
✦More common than rendering performance
Logic Performance
© Codename One 2017 all rights reserved
✦More common than rendering performance
✦CPU Starvation
Logic Performance
© Codename One 2017 all rights reserved
✦More common than rendering performance
✦CPU Starvation
✦Causes delay/bounce - not uniform impact
Logic Performance
© Codename One 2017 all rights reserved
✦More common than rendering performance
✦CPU Starvation
✦Causes delay/bounce - not uniform impact
✦Use caching/threading effectively to solve
Memory Thrashing & Crashes
© Codename One 2017 all rights reserved
✦GC Thrashing - rapid alloc/discard
Memory Thrashing & Crashes
© Codename One 2017 all rights reserved
✦GC Thrashing - rapid alloc/discard
✦Cache clearance
Perceived Performance
© Codename One 2017 all rights reserved
✦Experiment:
Perceived Performance
© Codename One 2017 all rights reserved
✦Experiment:
✓ Show a button after 1 second delay with no indication
Perceived Performance
© Codename One 2017 all rights reserved
✦Experiment:
✓ Show a button after 1 second delay with no indication
✓ Do the same with 2 seconds delay but write
“Loading…” on the button after the tap
Perceived Performance
© Codename One 2017 all rights reserved
✦Experiment:
✓ Show a button after 1 second delay with no indication
✓ Do the same with 2 seconds delay but write
“Loading…” on the button after the tap
✦The second version feels more responsive
Perceived Performance
© Codename One 2017 all rights reserved
✦Experiment:
✓ Show a button after 1 second delay with no indication
✓ Do the same with 2 seconds delay but write
“Loading…” on the button after the tap
✦The second version feels more responsive
✦Try to avoid InfiniteProgress, try to show cached data
and update in the background
Perceived Performance
© Codename One 2017 all rights reserved
✦Experiment:
✓ Show a button after 1 second delay with no indication
✓ Do the same with 2 seconds delay but write
“Loading…” on the button after the tap
✦The second version feels more responsive
✦Try to avoid InfiniteProgress, try to show cached data
and update in the background
✦This is probably the most common reason for end user
performance complaints!
Pareto Distribution: the 80-20 Rule
© Codename One 2017 all rights reserved
Pareto Distribution: the 80-20 Rule
© Codename One 2017 all rights reserved
The real problem is that programmers have
spent far too much time worrying about
efficiency in the wrong places and at the wrong
times; premature optimization is the root of all
evil (or at least most of it) in programming
Pareto Distribution: the 80-20 Rule
© Codename One 2017 all rights reserved
The real problem is that programmers have
spent far too much time worrying about
efficiency in the wrong places and at the wrong
times; premature optimization is the root of all
evil (or at least most of it) in programming
Pareto Distribution: the 80-20 Rule
© Codename One 2017 all rights reserved
The real problem is that programmers have
spent far too much time worrying about
efficiency in the wrong places and at the wrong
times; premature optimization is the root of all
evil (or at least most of it) in programming
Donald Knuth
Pareto Distribution: the 80-20 Rule
© Codename One 2017 all rights reserved
The real problem is that programmers have
spent far too much time worrying about
efficiency in the wrong places and at the wrong
times; premature optimization is the root of all
evil (or at least most of it) in programming
Donald Knuth
“
Pareto Distribution: the 80-20 Rule
© Codename One 2017 all rights reserved
✦When you spend time optimizing at an early stage you
will have an unmaintainable app
Pareto Distribution: the 80-20 Rule
© Codename One 2017 all rights reserved
✦When you spend time optimizing at an early stage you
will have an unmaintainable app
✦Caching is key
Pareto Distribution: the 80-20 Rule
© Codename One 2017 all rights reserved
✦When you spend time optimizing at an early stage you
will have an unmaintainable app
✦Caching is key
✦In my experience performance is more of a 98% - 2%
rule

More Related Content

Similar to Performance and Memory Tuning - Part I - Transcript.pdf

Business Success With Core Web Vitals | Izzi Smith
Business Success With Core Web Vitals | Izzi SmithBusiness Success With Core Web Vitals | Izzi Smith
Business Success With Core Web Vitals | Izzi SmithNoisy Little Monkey
 
Life of a Code Change to a Tier 1 Service - AWS Online Tech Talks
Life of a Code Change to a Tier 1 Service - AWS Online Tech TalksLife of a Code Change to a Tier 1 Service - AWS Online Tech Talks
Life of a Code Change to a Tier 1 Service - AWS Online Tech TalksAmazon Web Services
 
How do I - Use Include Source to debug native code.pdf
How do I - Use Include Source to debug native code.pdfHow do I - Use Include Source to debug native code.pdf
How do I - Use Include Source to debug native code.pdfShaiAlmog1
 
AI Based Test Automation Without AI
AI Based Test Automation Without AIAI Based Test Automation Without AI
AI Based Test Automation Without AIXBOSoft
 
Shift-left SRE: Self-healing on OpenShift with Ansible
Shift-left SRE: Self-healing on OpenShift with AnsibleShift-left SRE: Self-healing on OpenShift with Ansible
Shift-left SRE: Self-healing on OpenShift with AnsibleJürgen Etzlstorfer
 
Business Success with Core Web Vitals
Business Success with Core Web VitalsBusiness Success with Core Web Vitals
Business Success with Core Web VitalsIzzi Smith
 
What if you could eliminate the hidden costs of development?
What if you could eliminate the hidden costs of development?What if you could eliminate the hidden costs of development?
What if you could eliminate the hidden costs of development?Rogue Wave Software
 
NEW LAUNCH! Building Virtual Reality and Augmented Reality Applications with ...
NEW LAUNCH! Building Virtual Reality and Augmented Reality Applications with ...NEW LAUNCH! Building Virtual Reality and Augmented Reality Applications with ...
NEW LAUNCH! Building Virtual Reality and Augmented Reality Applications with ...Amazon Web Services
 
LESSONS LEARNED FROM ADOBE’S PERFORMANCE MANAGEMENT REVOLUTION
LESSONS LEARNED FROM ADOBE’S PERFORMANCE MANAGEMENT REVOLUTIONLESSONS LEARNED FROM ADOBE’S PERFORMANCE MANAGEMENT REVOLUTION
LESSONS LEARNED FROM ADOBE’S PERFORMANCE MANAGEMENT REVOLUTIONHuman Capital Media
 
Jun Heider - Flex Application Profiling By Example
Jun Heider - Flex Application Profiling By ExampleJun Heider - Flex Application Profiling By Example
Jun Heider - Flex Application Profiling By Example360|Conferences
 
Advertising Insights through Segmented Analytics - Adobe Summit 2017
Advertising Insights through Segmented Analytics  - Adobe Summit 2017Advertising Insights through Segmented Analytics  - Adobe Summit 2017
Advertising Insights through Segmented Analytics - Adobe Summit 2017Chris Haleua
 
re:Invent CON320 Tracing and Debugging for Containerized Services
re:Invent CON320 Tracing and Debugging for Containerized Servicesre:Invent CON320 Tracing and Debugging for Containerized Services
re:Invent CON320 Tracing and Debugging for Containerized ServicesCalvin French-Owen
 
Building Microservices with the Twelve-Factor App Pattern - SRV346 - Chicago ...
Building Microservices with the Twelve-Factor App Pattern - SRV346 - Chicago ...Building Microservices with the Twelve-Factor App Pattern - SRV346 - Chicago ...
Building Microservices with the Twelve-Factor App Pattern - SRV346 - Chicago ...Amazon Web Services
 
加速するデータドリブンコミュニケーション
加速するデータドリブンコミュニケーション加速するデータドリブンコミュニケーション
加速するデータドリブンコミュニケーションKeisuke Anzai
 
プロトタイプでWeb制作の手戻りを減らせ!アドビ初のUI/UXデザインツール、Adobe XDのススメ
プロトタイプでWeb制作の手戻りを減らせ!アドビ初のUI/UXデザインツール、Adobe XDのススメプロトタイプでWeb制作の手戻りを減らせ!アドビ初のUI/UXデザインツール、Adobe XDのススメ
プロトタイプでWeb制作の手戻りを減らせ!アドビ初のUI/UXデザインツール、Adobe XDのススメKeisuke Todoroki
 
From Monolith to Microservices (And All the Bumps along the Way) (CON360-R1) ...
From Monolith to Microservices (And All the Bumps along the Way) (CON360-R1) ...From Monolith to Microservices (And All the Bumps along the Way) (CON360-R1) ...
From Monolith to Microservices (And All the Bumps along the Way) (CON360-R1) ...Amazon Web Services
 

Similar to Performance and Memory Tuning - Part I - Transcript.pdf (20)

Business Success With Core Web Vitals | Izzi Smith
Business Success With Core Web Vitals | Izzi SmithBusiness Success With Core Web Vitals | Izzi Smith
Business Success With Core Web Vitals | Izzi Smith
 
Life of a Code Change to a Tier 1 Service - AWS Online Tech Talks
Life of a Code Change to a Tier 1 Service - AWS Online Tech TalksLife of a Code Change to a Tier 1 Service - AWS Online Tech Talks
Life of a Code Change to a Tier 1 Service - AWS Online Tech Talks
 
How do I - Use Include Source to debug native code.pdf
How do I - Use Include Source to debug native code.pdfHow do I - Use Include Source to debug native code.pdf
How do I - Use Include Source to debug native code.pdf
 
AI Based Test Automation Without AI
AI Based Test Automation Without AIAI Based Test Automation Without AI
AI Based Test Automation Without AI
 
Shift-left SRE: Self-healing on OpenShift with Ansible
Shift-left SRE: Self-healing on OpenShift with AnsibleShift-left SRE: Self-healing on OpenShift with Ansible
Shift-left SRE: Self-healing on OpenShift with Ansible
 
Business Success with Core Web Vitals
Business Success with Core Web VitalsBusiness Success with Core Web Vitals
Business Success with Core Web Vitals
 
What if you could eliminate the hidden costs of development?
What if you could eliminate the hidden costs of development?What if you could eliminate the hidden costs of development?
What if you could eliminate the hidden costs of development?
 
Visual testing
Visual testingVisual testing
Visual testing
 
NEW LAUNCH! Building Virtual Reality and Augmented Reality Applications with ...
NEW LAUNCH! Building Virtual Reality and Augmented Reality Applications with ...NEW LAUNCH! Building Virtual Reality and Augmented Reality Applications with ...
NEW LAUNCH! Building Virtual Reality and Augmented Reality Applications with ...
 
LESSONS LEARNED FROM ADOBE’S PERFORMANCE MANAGEMENT REVOLUTION
LESSONS LEARNED FROM ADOBE’S PERFORMANCE MANAGEMENT REVOLUTIONLESSONS LEARNED FROM ADOBE’S PERFORMANCE MANAGEMENT REVOLUTION
LESSONS LEARNED FROM ADOBE’S PERFORMANCE MANAGEMENT REVOLUTION
 
Webinar-DevOps.pdf
Webinar-DevOps.pdfWebinar-DevOps.pdf
Webinar-DevOps.pdf
 
Your Flight is Boarding Now!
Your Flight is Boarding Now!Your Flight is Boarding Now!
Your Flight is Boarding Now!
 
Jun Heider - Flex Application Profiling By Example
Jun Heider - Flex Application Profiling By ExampleJun Heider - Flex Application Profiling By Example
Jun Heider - Flex Application Profiling By Example
 
Advertising Insights through Segmented Analytics - Adobe Summit 2017
Advertising Insights through Segmented Analytics  - Adobe Summit 2017Advertising Insights through Segmented Analytics  - Adobe Summit 2017
Advertising Insights through Segmented Analytics - Adobe Summit 2017
 
re:Invent CON320 Tracing and Debugging for Containerized Services
re:Invent CON320 Tracing and Debugging for Containerized Servicesre:Invent CON320 Tracing and Debugging for Containerized Services
re:Invent CON320 Tracing and Debugging for Containerized Services
 
DevOps Culture at Amazon
DevOps Culture at AmazonDevOps Culture at Amazon
DevOps Culture at Amazon
 
Building Microservices with the Twelve-Factor App Pattern - SRV346 - Chicago ...
Building Microservices with the Twelve-Factor App Pattern - SRV346 - Chicago ...Building Microservices with the Twelve-Factor App Pattern - SRV346 - Chicago ...
Building Microservices with the Twelve-Factor App Pattern - SRV346 - Chicago ...
 
加速するデータドリブンコミュニケーション
加速するデータドリブンコミュニケーション加速するデータドリブンコミュニケーション
加速するデータドリブンコミュニケーション
 
プロトタイプでWeb制作の手戻りを減らせ!アドビ初のUI/UXデザインツール、Adobe XDのススメ
プロトタイプでWeb制作の手戻りを減らせ!アドビ初のUI/UXデザインツール、Adobe XDのススメプロトタイプでWeb制作の手戻りを減らせ!アドビ初のUI/UXデザインツール、Adobe XDのススメ
プロトタイプでWeb制作の手戻りを減らせ!アドビ初のUI/UXデザインツール、Adobe XDのススメ
 
From Monolith to Microservices (And All the Bumps along the Way) (CON360-R1) ...
From Monolith to Microservices (And All the Bumps along the Way) (CON360-R1) ...From Monolith to Microservices (And All the Bumps along the Way) (CON360-R1) ...
From Monolith to Microservices (And All the Bumps along the Way) (CON360-R1) ...
 

More from ShaiAlmog1

The Duck Teaches Learn to debug from the masters. Local to production- kill ...
The Duck Teaches  Learn to debug from the masters. Local to production- kill ...The Duck Teaches  Learn to debug from the masters. Local to production- kill ...
The Duck Teaches Learn to debug from the masters. Local to production- kill ...ShaiAlmog1
 
create-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdfcreate-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdfShaiAlmog1
 
create-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdfcreate-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdfShaiAlmog1
 
create-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdfcreate-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdfShaiAlmog1
 
create-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdfcreate-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdfShaiAlmog1
 
create-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfcreate-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfShaiAlmog1
 
create-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdfcreate-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdfShaiAlmog1
 
create-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfcreate-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfShaiAlmog1
 
create-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfcreate-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfShaiAlmog1
 
create-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdfcreate-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdfShaiAlmog1
 
create-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfcreate-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfShaiAlmog1
 
create-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfcreate-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfShaiAlmog1
 
create-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdfcreate-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdfCreating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdfCreating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfCreating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdfCreating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfCreating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdfCreating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfCreating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfShaiAlmog1
 

More from ShaiAlmog1 (20)

The Duck Teaches Learn to debug from the masters. Local to production- kill ...
The Duck Teaches  Learn to debug from the masters. Local to production- kill ...The Duck Teaches  Learn to debug from the masters. Local to production- kill ...
The Duck Teaches Learn to debug from the masters. Local to production- kill ...
 
create-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdfcreate-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdf
 
create-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdfcreate-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdf
 
create-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdfcreate-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdf
 
create-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdfcreate-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdf
 
create-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfcreate-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdf
 
create-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdfcreate-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdf
 
create-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfcreate-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdf
 
create-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfcreate-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdf
 
create-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdfcreate-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdf
 
create-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfcreate-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdf
 
create-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfcreate-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdf
 
create-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdfcreate-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdf
 
Creating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdfCreating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdf
 
Creating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdfCreating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdf
 
Creating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfCreating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdf
 
Creating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdfCreating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdf
 
Creating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfCreating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdf
 
Creating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdfCreating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdf
 
Creating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfCreating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdf
 

Recently uploaded

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Recently uploaded (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Performance and Memory Tuning - Part I - Transcript.pdf

  • 1. Performance & Memory Tuning - Part I
  • 2. How This Module Is Structured © Codename One 2017 all rights reserved ✦Performance Tips
  • 3. How This Module Is Structured © Codename One 2017 all rights reserved ✦Performance Tips ✦Root causes (profiling)
  • 4. How This Module Is Structured © Codename One 2017 all rights reserved ✦Performance Tips ✦Root causes (profiling) ✦Real World Example
  • 5. What is Performance? © Codename One 2017 all rights reserved
  • 6. What is Performance? © Codename One 2017 all rights reserved ✦Rendering Performance ✦Logic Performance ✦Memory Thrashing & Crashes ✦Perceived Performance ✦Pareto distribution
  • 7. Rendering Performance © Codename One 2017 all rights reserved ✦Framerate
  • 8. Rendering Performance © Codename One 2017 all rights reserved ✦Framerate ✦Feels less smooth
  • 9. Rendering Performance © Codename One 2017 all rights reserved ✦Framerate ✦Feels less smooth ✦Animations & scrolling feel jumpy
  • 10. Rendering Performance © Codename One 2017 all rights reserved ✦Framerate ✦Feels less smooth ✦Animations & scrolling feel jumpy ✦Small issues
  • 11. Rendering Performance © Codename One 2017 all rights reserved ✦Framerate ✦Feels less smooth ✦Animations & scrolling feel jumpy ✦Small issues ✦Need to render a frame within 16 milliseconds for 60fps
  • 12. Logic Performance © Codename One 2017 all rights reserved ✦More common than rendering performance
  • 13. Logic Performance © Codename One 2017 all rights reserved ✦More common than rendering performance ✦CPU Starvation
  • 14. Logic Performance © Codename One 2017 all rights reserved ✦More common than rendering performance ✦CPU Starvation ✦Causes delay/bounce - not uniform impact
  • 15. Logic Performance © Codename One 2017 all rights reserved ✦More common than rendering performance ✦CPU Starvation ✦Causes delay/bounce - not uniform impact ✦Use caching/threading effectively to solve
  • 16. Memory Thrashing & Crashes © Codename One 2017 all rights reserved ✦GC Thrashing - rapid alloc/discard
  • 17. Memory Thrashing & Crashes © Codename One 2017 all rights reserved ✦GC Thrashing - rapid alloc/discard ✦Cache clearance
  • 18. Perceived Performance © Codename One 2017 all rights reserved ✦Experiment:
  • 19. Perceived Performance © Codename One 2017 all rights reserved ✦Experiment: ✓ Show a button after 1 second delay with no indication
  • 20. Perceived Performance © Codename One 2017 all rights reserved ✦Experiment: ✓ Show a button after 1 second delay with no indication ✓ Do the same with 2 seconds delay but write “Loading…” on the button after the tap
  • 21. Perceived Performance © Codename One 2017 all rights reserved ✦Experiment: ✓ Show a button after 1 second delay with no indication ✓ Do the same with 2 seconds delay but write “Loading…” on the button after the tap ✦The second version feels more responsive
  • 22. Perceived Performance © Codename One 2017 all rights reserved ✦Experiment: ✓ Show a button after 1 second delay with no indication ✓ Do the same with 2 seconds delay but write “Loading…” on the button after the tap ✦The second version feels more responsive ✦Try to avoid InfiniteProgress, try to show cached data and update in the background
  • 23. Perceived Performance © Codename One 2017 all rights reserved ✦Experiment: ✓ Show a button after 1 second delay with no indication ✓ Do the same with 2 seconds delay but write “Loading…” on the button after the tap ✦The second version feels more responsive ✦Try to avoid InfiniteProgress, try to show cached data and update in the background ✦This is probably the most common reason for end user performance complaints!
  • 24. Pareto Distribution: the 80-20 Rule © Codename One 2017 all rights reserved
  • 25. Pareto Distribution: the 80-20 Rule © Codename One 2017 all rights reserved The real problem is that programmers have spent far too much time worrying about efficiency in the wrong places and at the wrong times; premature optimization is the root of all evil (or at least most of it) in programming
  • 26. Pareto Distribution: the 80-20 Rule © Codename One 2017 all rights reserved The real problem is that programmers have spent far too much time worrying about efficiency in the wrong places and at the wrong times; premature optimization is the root of all evil (or at least most of it) in programming
  • 27. Pareto Distribution: the 80-20 Rule © Codename One 2017 all rights reserved The real problem is that programmers have spent far too much time worrying about efficiency in the wrong places and at the wrong times; premature optimization is the root of all evil (or at least most of it) in programming Donald Knuth
  • 28. Pareto Distribution: the 80-20 Rule © Codename One 2017 all rights reserved The real problem is that programmers have spent far too much time worrying about efficiency in the wrong places and at the wrong times; premature optimization is the root of all evil (or at least most of it) in programming Donald Knuth “
  • 29. Pareto Distribution: the 80-20 Rule © Codename One 2017 all rights reserved ✦When you spend time optimizing at an early stage you will have an unmaintainable app
  • 30. Pareto Distribution: the 80-20 Rule © Codename One 2017 all rights reserved ✦When you spend time optimizing at an early stage you will have an unmaintainable app ✦Caching is key
  • 31. Pareto Distribution: the 80-20 Rule © Codename One 2017 all rights reserved ✦When you spend time optimizing at an early stage you will have an unmaintainable app ✦Caching is key ✦In my experience performance is more of a 98% - 2% rule