SlideShare a Scribd company logo
Short Intro for Project Butter
Yoshi@8/5/2015
(Photo by Malcolm Dunbar/Picture Post/Getty Images)
Project Butter is…?
• Butter, smoothness, for better UX
• Started at Android 4.1 (2012, API Level 16)
• Three main parts
– VSync
– Triple Buffering
– Touch Responsiveness (Choreographer)
Pseudocode of VSync-Style Program
No VSync Style VSync Style
VSync is … (In Android)
• A periodical interrupt
– To call your callback function
• Two possible implementations
1.Hardware timer
2.Software simulation
• A high priority thread which wakes up every 16.7ms
With and Without VSync
No VSync
With VSync
VSyncThread
Either HW or SW implementation
“Triple” Buffers?
• It doesn’t mean to buffer something in many
contexts
– Not a verb, but a noun
– It’s more like # of buffers it uses
• It can be proved that only 3 buffers are
required at most
– So you will never see 4+ buffer in game settings of
a game
Triple Buffer
Double buffer (A,B)
Triple Buffer (A,B,C)
Intro to Choreographer
• Choreographer (from Android Doc)
– Coordinates the timing of animations, input and
drawing
– The choreographer receives timing pulses (such as
vertical synchronization) from the display subsystem
• Schedules work to occur as part of rendering the next
display frame
Image:
http://jordanmleczko.weebly.com/my-future.html
Using Choreographer to Detect FPS
and Frame Dropping
https://github.com/yoshijava/Choreographer
Issue of Choreographer
Choreographer is designed to bind
with a specific looper (of an app)
But we need a system-wide frame-dropping and FPS notifier
Choreographer
VSyncThread (HW or SW)
VSync signals
looper
looper
looper
looper
Choreographer
Choreographer
Choreographer
Looper.myLooper();
Static method; Thread-Local Storage (TLS)
Choreographer has no public constructor, only static getInstance()
Static method; Thread-Local Storage (TLS)
Using Choreographer in any Activity
How about extending ChoreographerTest?
With callback, we can get # of
dropped frames and estimate
FPS manually
Summary
• Project Butter is not a new thing
– VSync and triple buffer are an old thing in desktop
– However, introduced to Android in 2012
• Choreographer is “per app” design
– Every app developer can optimize their apps by
getting notified when VSync signal comes
– Note that it is not system-wide (?)

More Related Content

PPTX
Communication in android
PPT
Asp.net control
PDF
Android Programming Basics
PDF
AndroidManifest
PDF
Simulating TUM Drone 2.0 by ROS
PPTX
introduction to flutter ppt - free download
PPTX
Android PPT Presentation 2018
PPTX
Android studio installation
Communication in android
Asp.net control
Android Programming Basics
AndroidManifest
Simulating TUM Drone 2.0 by ROS
introduction to flutter ppt - free download
Android PPT Presentation 2018
Android studio installation

What's hot (20)

PPT
Unix fundamentals and_shell scripting
PPTX
Firebase
PPT
PPT
Android Radio Layer Interface
PDF
Android Session.pdf
PDF
Linux Internals - Interview essentials - 1.0
PPT
C sharp
PDF
Reusing your existing software on Android
PPT
Basic Unix
PDF
An Introduction to the Android Framework -- a core architecture view from app...
PPT
Android lifecycle
PPTX
Notification android
PPT
Life of a Chromium Developer
PPTX
What is Flutter
PPTX
Introduction to Android and Android Studio
PDF
Tema 12 hilos en java por gio
PPTX
PPTX
Protecting Apps from Hacks in Kubernetes with NGINX
PPTX
Linux kernel
PPTX
Dot net platform and dotnet core fundamentals
Unix fundamentals and_shell scripting
Firebase
Android Radio Layer Interface
Android Session.pdf
Linux Internals - Interview essentials - 1.0
C sharp
Reusing your existing software on Android
Basic Unix
An Introduction to the Android Framework -- a core architecture view from app...
Android lifecycle
Notification android
Life of a Chromium Developer
What is Flutter
Introduction to Android and Android Studio
Tema 12 hilos en java por gio
Protecting Apps from Hacks in Kubernetes with NGINX
Linux kernel
Dot net platform and dotnet core fundamentals
Ad

Similar to Short intro to project butter (8)

PDF
The Road to 60 FPS
PDF
Asynchronous Programming in Android
PPTX
Android - Graphics Animation in Android
PDF
Programming Sideways: Asynchronous Techniques for Android
PPTX
Efficient Android Threading
ODP
Android App Development - 07 Threading
PDF
Tools and Techniques for Understanding Threading Behavior in Android
PDF
Android Best Practices - Thoughts from the Trenches
The Road to 60 FPS
Asynchronous Programming in Android
Android - Graphics Animation in Android
Programming Sideways: Asynchronous Techniques for Android
Efficient Android Threading
Android App Development - 07 Threading
Tools and Techniques for Understanding Threading Behavior in Android
Android Best Practices - Thoughts from the Trenches
Ad

More from Yoshi Shih-Chieh Huang (7)

PPTX
Architectural modeling
PPTX
Flash knowledge
PPTX
Usage and Comparisons of Control Group in Android AOSP: Marshmallow and Before
PPTX
Attackboard slides dac12-0605
PPTX
On the End-to-End Traffic Prediction in the On-Chip Networks
PPTX
PPTX
Introduction to amazon web service (clean)
Architectural modeling
Flash knowledge
Usage and Comparisons of Control Group in Android AOSP: Marshmallow and Before
Attackboard slides dac12-0605
On the End-to-End Traffic Prediction in the On-Chip Networks
Introduction to amazon web service (clean)

Recently uploaded (20)

PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
top salesforce developer skills in 2025.pdf
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
history of c programming in notes for students .pptx
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Essential Infomation Tech presentation.pptx
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
ai tools demonstartion for schools and inter college
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
L1 - Introduction to python Backend.pptx
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
How to Choose the Right IT Partner for Your Business in Malaysia
top salesforce developer skills in 2025.pdf
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Which alternative to Crystal Reports is best for small or large businesses.pdf
history of c programming in notes for students .pptx
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Essential Infomation Tech presentation.pptx
Navsoft: AI-Powered Business Solutions & Custom Software Development
ai tools demonstartion for schools and inter college
2025 Textile ERP Trends: SAP, Odoo & Oracle
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
L1 - Introduction to python Backend.pptx
Odoo Companies in India – Driving Business Transformation.pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
CHAPTER 2 - PM Management and IT Context
wealthsignaloriginal-com-DS-text-... (1).pdf
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf

Short intro to project butter

  • 1. Short Intro for Project Butter Yoshi@8/5/2015 (Photo by Malcolm Dunbar/Picture Post/Getty Images)
  • 2. Project Butter is…? • Butter, smoothness, for better UX • Started at Android 4.1 (2012, API Level 16) • Three main parts – VSync – Triple Buffering – Touch Responsiveness (Choreographer)
  • 3. Pseudocode of VSync-Style Program No VSync Style VSync Style
  • 4. VSync is … (In Android) • A periodical interrupt – To call your callback function • Two possible implementations 1.Hardware timer 2.Software simulation • A high priority thread which wakes up every 16.7ms
  • 5. With and Without VSync No VSync With VSync
  • 6. VSyncThread Either HW or SW implementation
  • 7. “Triple” Buffers? • It doesn’t mean to buffer something in many contexts – Not a verb, but a noun – It’s more like # of buffers it uses • It can be proved that only 3 buffers are required at most – So you will never see 4+ buffer in game settings of a game
  • 8. Triple Buffer Double buffer (A,B) Triple Buffer (A,B,C)
  • 9. Intro to Choreographer • Choreographer (from Android Doc) – Coordinates the timing of animations, input and drawing – The choreographer receives timing pulses (such as vertical synchronization) from the display subsystem • Schedules work to occur as part of rendering the next display frame Image: http://jordanmleczko.weebly.com/my-future.html
  • 10. Using Choreographer to Detect FPS and Frame Dropping https://github.com/yoshijava/Choreographer
  • 11. Issue of Choreographer Choreographer is designed to bind with a specific looper (of an app) But we need a system-wide frame-dropping and FPS notifier
  • 12. Choreographer VSyncThread (HW or SW) VSync signals looper looper looper looper Choreographer Choreographer Choreographer
  • 13. Looper.myLooper(); Static method; Thread-Local Storage (TLS) Choreographer has no public constructor, only static getInstance() Static method; Thread-Local Storage (TLS)
  • 14. Using Choreographer in any Activity How about extending ChoreographerTest?
  • 15. With callback, we can get # of dropped frames and estimate FPS manually
  • 16. Summary • Project Butter is not a new thing – VSync and triple buffer are an old thing in desktop – However, introduced to Android in 2012 • Choreographer is “per app” design – Every app developer can optimize their apps by getting notified when VSync signal comes – Note that it is not system-wide (?)