power and performance€¦ · 35% reduction in cpu power usage testing conducted by apple in june...
TRANSCRIPT
![Page 1: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/1.jpg)
These are confidential sessions—please refrain from streaming, blogging, or taking pictures
Optimizing your website for great battery life and responsive scrolling
Session 607
Power and Performance
Simon FraserSafari and WebKit Engineer
![Page 2: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/2.jpg)
![Page 3: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/3.jpg)
![Page 4: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/4.jpg)
![Page 5: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/5.jpg)
![Page 6: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/6.jpg)
![Page 7: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/7.jpg)
![Page 8: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/8.jpg)
![Page 9: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/9.jpg)
What You Will Learn
![Page 10: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/10.jpg)
What You Will Learn
•New power-saving features in Safari
![Page 11: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/11.jpg)
What You Will Learn
•New power-saving features in Safari•Making power-efficient webpages
![Page 12: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/12.jpg)
What You Will Learn
•New power-saving features in Safari•Making power-efficient webpages• Safari responsive scrolling
![Page 13: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/13.jpg)
Safari Power-Saving Features
![Page 14: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/14.jpg)
Power-Saving Features
![Page 15: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/15.jpg)
Power-Saving Features
•App Nap for Safari tabs
![Page 16: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/16.jpg)
Power-Saving Features
•App Nap for Safari tabs• Power Saver
![Page 17: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/17.jpg)
App Nap for Safari TabsNew in Safari 7
![Page 18: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/18.jpg)
App Nap for Safari TabsNew in Safari 7
![Page 19: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/19.jpg)
What Is App Nap for Safari Tabs?
![Page 20: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/20.jpg)
What Is App Nap for Safari Tabs?
• Each tab has its own Safari Web Content process
![Page 21: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/21.jpg)
What Is App Nap for Safari Tabs?
• Each tab has its own Safari Web Content process•App Nap is applied to the Safari Web Content process for that tab
![Page 22: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/22.jpg)
What Is App Nap for Safari Tabs?
• Each tab has its own Safari Web Content process•App Nap is applied to the Safari Web Content process for that tab • Saves power by napping background tabs
![Page 23: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/23.jpg)
When Are Tabs Napped?
![Page 24: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/24.jpg)
When Are Tabs Napped?
• Tab is not visible■ Background tab■ Minimized window■ In another space■ Screen saver is on■ Occluded window
![Page 25: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/25.jpg)
When Are Tabs Napped?
• Tab is not visible■ Background tab■ Minimized window■ In another space■ Screen saver is on■ Occluded window
• Idle windows
![Page 26: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/26.jpg)
Effects of App Nap for Safari Tabs
![Page 27: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/27.jpg)
Effects of App Nap for Safari Tabs
• JavaScript timers are rate-limited
![Page 28: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/28.jpg)
Effects of App Nap for Safari Tabs
• JavaScript timers are rate-limited■ setTimeout(), setInterval()
![Page 29: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/29.jpg)
Effects of App Nap for Safari Tabs
• JavaScript timers are rate-limited■ setTimeout(), setInterval()■ requestAnimationFrame()
![Page 30: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/30.jpg)
Effects of App Nap for Safari Tabs
• JavaScript timers are rate-limited■ setTimeout(), setInterval()■ requestAnimationFrame()
•Napping prevented when
![Page 31: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/31.jpg)
Effects of App Nap for Safari Tabs
• JavaScript timers are rate-limited■ setTimeout(), setInterval()■ requestAnimationFrame()
•Napping prevented when■ Playing audio
![Page 32: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/32.jpg)
Effects of App Nap for Safari Tabs
• JavaScript timers are rate-limited■ setTimeout(), setInterval()■ requestAnimationFrame()
•Napping prevented when■ Playing audio■ Loading
![Page 33: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/33.jpg)
What You Should Do
![Page 34: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/34.jpg)
What You Should Do
•Often nothing
![Page 35: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/35.jpg)
What You Should Do
•Often nothing• But be prepared for timer rate-limiting
![Page 36: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/36.jpg)
New in Safari 7App Nap for Safari Tabs
![Page 37: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/37.jpg)
New in Safari 7Safari Power Saver
![Page 38: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/38.jpg)
![Page 39: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/39.jpg)
35%Reduction In CPU Power Usage
Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with 4GB of RAM and prerelease OS X v10.9. Tested with prerelease Safari 7.0 with Power Saver on (default) vs. off. Systems tested with WPA2 Wi-Fi network connection while running on battery power. Performance will vary based on system configuration, application workload, and other factors.
Up to
![Page 40: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/40.jpg)
![Page 41: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/41.jpg)
![Page 42: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/42.jpg)
![Page 43: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/43.jpg)
![Page 44: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/44.jpg)
![Page 45: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/45.jpg)
![Page 46: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/46.jpg)
![Page 47: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/47.jpg)
![Page 48: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/48.jpg)
Smart Power-Saving
![Page 49: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/49.jpg)
Smart Power-Saving
• “Primary” plug-ins continue to play
![Page 50: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/50.jpg)
Smart Power-Saving
• “Primary” plug-ins continue to play• Plug-ins that are not being used for visual purposes continue to play
![Page 51: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/51.jpg)
Smart Power-Saving
• “Primary” plug-ins continue to play• Plug-ins that are not being used for visual purposes continue to play• Remember the user’s choice
![Page 52: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/52.jpg)
How Safari Power Saver Works
![Page 53: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/53.jpg)
How Safari Power Saver Works
•What happens to a plug-in when power-saved:
![Page 54: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/54.jpg)
How Safari Power Saver Works
•What happens to a plug-in when power-saved:■ Runs until it has drawn a useful snapshot
![Page 55: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/55.jpg)
How Safari Power Saver Works
•What happens to a plug-in when power-saved:■ Runs until it has drawn a useful snapshot■ Replaced with the snapshot
![Page 56: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/56.jpg)
How Safari Power Saver Works
•What happens to a plug-in when power-saved:■ Runs until it has drawn a useful snapshot■ Replaced with the snapshot■ If the user clicks the snapshot, plug-in is re-created
![Page 57: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/57.jpg)
![Page 58: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/58.jpg)
![Page 59: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/59.jpg)
What You Should Do
![Page 60: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/60.jpg)
What You Should Do
•Use fewer plug-ins
![Page 61: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/61.jpg)
What You Should Do
•Use fewer plug-ins■ Don’t use a plug-in when you could use an existing web feature
![Page 62: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/62.jpg)
What You Should Do
•Use fewer plug-ins■ Don’t use a plug-in when you could use an existing web feature
• Be prepared for plug-ins to be destroyed and re-created
![Page 63: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/63.jpg)
What You Should Do
•Use fewer plug-ins■ Don’t use a plug-in when you could use an existing web feature
• Be prepared for plug-ins to be destroyed and re-created■ Request state from the page, not vice versa
![Page 64: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/64.jpg)
New in Safari 7Safari Power Saver
![Page 65: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/65.jpg)
How to detect and fix problemsMaking Power-Efficient Webpages
![Page 66: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/66.jpg)
Making Power-Efficient Webpages
![Page 67: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/67.jpg)
Making Power-Efficient Webpages
•New web API
![Page 68: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/68.jpg)
Making Power-Efficient Webpages
•New web API • Tools to detect power-hungry pages
![Page 69: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/69.jpg)
Making Power-Efficient Webpages
•New web API • Tools to detect power-hungry pages• Common mistakes
![Page 70: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/70.jpg)
Making Power-Efficient Webpages
•New web API • Tools to detect power-hungry pages• Common mistakes
![Page 71: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/71.jpg)
Web APIs for Power-Smart Pages
![Page 72: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/72.jpg)
Web APIs for Power-Smart Pages
• Page Visibility
![Page 73: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/73.jpg)
Web APIs for Power-Smart Pages
• Page Visibility• requestAnimationFrame()
![Page 74: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/74.jpg)
Page Visibility
![Page 75: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/75.jpg)
Page Visibility
![Page 76: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/76.jpg)
Page Visibility
•Web API for content to detect when:■ Page is hidden■ Visibility changes
![Page 77: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/77.jpg)
Page Visibility
•Web API for content to detect when:■ Page is hidden■ Visibility changes
• Pages hidden in:■ Background tabs■ Minimized windows■ Occluded windows
![Page 78: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/78.jpg)
Page Visibility
![Page 79: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/79.jpg)
Page Visibility
•When hidden:
![Page 80: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/80.jpg)
Page Visibility
•When hidden:■ JavaScript timers are rate-limited
![Page 81: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/81.jpg)
Page Visibility
•When hidden:■ JavaScript timers are rate-limited■ requestAnimationFrame() is paused
![Page 82: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/82.jpg)
Page Visibility
•When hidden:■ JavaScript timers are rate-limited■ requestAnimationFrame() is paused■ CSS Transitions and Animations paused
![Page 83: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/83.jpg)
Page Visibility
•Query current statedocument.hiddendocument.visibilityState
“hidden”, “visible”, “prerender”
![Page 84: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/84.jpg)
Page Visibility
•Query current statedocument.hiddendocument.visibilityState
“hidden”, “visible”, “prerender”
![Page 85: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/85.jpg)
Page Visibility
•Query current statedocument.hiddendocument.visibilityState
“hidden”, “visible”, “prerender”
![Page 86: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/86.jpg)
Page Visibility
•Query current statedocument.hiddendocument.visibilityState
“hidden”, “visible”, “prerender”
• Listen for state changesdocument.addEventListener('visibilitychange', function(event) {
if (document.hidden) { ...}
}, false);
![Page 87: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/87.jpg)
Page Visibility
•Query current statedocument.hiddendocument.visibilityState
“hidden”, “visible”, “prerender”
• Listen for state changesdocument.addEventListener('visibilitychange', function(event) {
if (document.hidden) { ...}
}, false);
![Page 88: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/88.jpg)
Page Visibility
•Query current statedocument.hiddendocument.visibilityState
“hidden”, “visible”, “prerender”
• Listen for state changesdocument.addEventListener('visibilitychange', function(event) {
if (document.hidden) { ...}
}, false);
![Page 89: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/89.jpg)
Page Visibility
Safari 6.1 Safari 7 iOS7
![Page 90: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/90.jpg)
Scripted Animation
![Page 91: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/91.jpg)
Scripted Animation
• Problems using JavaScript timers for animation
![Page 92: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/92.jpg)
Scripted Animation
• Problems using JavaScript timers for animation■ How often to run?
![Page 93: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/93.jpg)
Scripted Animation
• Problems using JavaScript timers for animation■ How often to run?■ Browser can’t know that you’re just animating
![Page 94: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/94.jpg)
requestAnimationFrame()
![Page 95: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/95.jpg)
requestAnimationFrame()
•Web API for animation:window.requestAnimationFrame(callback);
![Page 96: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/96.jpg)
requestAnimationFrame()
•Web API for animation:window.requestAnimationFrame(callback);window.cancelAnimationFrame(id);
![Page 97: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/97.jpg)
requestAnimationFrame()
•Web API for animation:window.requestAnimationFrame(callback);window.cancelAnimationFrame(id);
•Advantages
![Page 98: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/98.jpg)
requestAnimationFrame()
•Web API for animation:window.requestAnimationFrame(callback);window.cancelAnimationFrame(id);
•Advantages■ Display-refresh friendly
![Page 99: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/99.jpg)
requestAnimationFrame()
•Web API for animation:window.requestAnimationFrame(callback);window.cancelAnimationFrame(id);
•Advantages■ Display-refresh friendly■ Pausable
![Page 100: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/100.jpg)
requestAnimationFrame()
•Web API for animation:window.requestAnimationFrame(callback);window.cancelAnimationFrame(id);
•Advantages■ Display-refresh friendly■ Pausable
![Page 101: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/101.jpg)
function doAnimation() {// Compute offset into animation// using new Date().…// Update visuals.…// Use setTimeout() to get called in about 16ms.setTimeout(doAnimation, 16);
}
Before requestAnimationFrame()
![Page 102: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/102.jpg)
function doAnimation(currentTime) {// Compute offset into animation using currentTime.// currentTime is milliseconds since the document started to load.…// Update visuals.…// Optionally, queue up another callback.requestAnimationFrame(doAnimation);
}
With requestAnimationFrame()
![Page 103: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/103.jpg)
function doAnimation(currentTime) {// Compute offset into animation using currentTime.// currentTime is milliseconds since the document started to load.…// Update visuals.…// Optionally, queue up another callback.requestAnimationFrame(doAnimation);
}
With requestAnimationFrame()
![Page 104: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/104.jpg)
function doAnimation(currentTime) {// Compute offset into animation using currentTime.// currentTime is milliseconds since the document started to load.…// Update visuals.…// Optionally, queue up another callback.requestAnimationFrame(doAnimation);
}
With requestAnimationFrame()
![Page 105: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/105.jpg)
requestAnimationFrame()
Safari 6.1 Safari 7 iOS7Safari 6.1 Safari 7 iOS7
![Page 106: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/106.jpg)
What You Should Do
![Page 107: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/107.jpg)
What You Should Do
•Use Page Visibility to stop doing work in hidden pages
![Page 108: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/108.jpg)
What You Should Do
•Use Page Visibility to stop doing work in hidden pages• If you have to do JavaScript animation, use requestAnimationFrame()
![Page 109: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/109.jpg)
What You Should Do
•Use Page Visibility to stop doing work in hidden pages• If you have to do JavaScript animation, use requestAnimationFrame()• Separate business logic from visual updates
![Page 110: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/110.jpg)
What You Should Do
•Use Page Visibility to stop doing work in hidden pages• If you have to do JavaScript animation, use requestAnimationFrame()• Separate business logic from visual updates
■ Remember that transitions and animations are affected by visibility
![Page 111: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/111.jpg)
DemoPage Visibility
Tim HortonSafari and WebKit Engineer
![Page 112: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/112.jpg)
Making Power-Efficient Webpages
•New web API • Tools to detect power-hungry pages• Common mistakes
![Page 113: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/113.jpg)
Making Power-Efficient Webpages
•New web API • Tools to detect power-hungry pages• Common mistakes
![Page 114: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/114.jpg)
How to Detect Power-Hungry Webpages
![Page 115: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/115.jpg)
How to Detect Power-Hungry Webpages
• System tools
![Page 116: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/116.jpg)
How to Detect Power-Hungry Webpages
• System tools•Web Inspector
![Page 117: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/117.jpg)
Detecting Power-Hungry PagesActivity Monitor
![Page 118: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/118.jpg)
Detecting Power-Hungry PagesActivity Monitor
![Page 119: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/119.jpg)
Detecting Power-Hungry PagesBattery Menu
![Page 120: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/120.jpg)
Detecting Power-Hungry PagesSafari Web Inspector
![Page 121: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/121.jpg)
Detecting Power-Hungry PagesSafari Web Inspector
![Page 122: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/122.jpg)
Detecting Power-Hungry PagesSafari Web Inspector
![Page 123: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/123.jpg)
Detecting Power-Hungry PagesSafari Web Inspector
![Page 124: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/124.jpg)
Detecting Power-Hungry PagesSafari Web Inspector
![Page 125: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/125.jpg)
Making Power-Efficient Webpages
•New web API • Tools to detect power-hungry pages• Common mistakes
![Page 126: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/126.jpg)
Making Power-Efficient Webpages
•New web API • Tools to detect power-hungry pages• Common mistakes
![Page 127: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/127.jpg)
Avoid Power-Hungry Mistakes
![Page 128: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/128.jpg)
Avoid Power-Hungry Mistakes
• Causing too much layout
![Page 129: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/129.jpg)
Avoid Power-Hungry Mistakes
• Causing too much layout• Painting too much
![Page 130: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/130.jpg)
Things That Can Force Layout
![Page 131: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/131.jpg)
Things That Can Force Layout
offsetLeft, offsetTop, offsetWidth, offsetHeightclientLeft, clientTop, clientWidth, clientHeightscrollLeft, scrollTop, scrollWith, scrollHeightscrollX, scrollY, scrollBy(), scrollTo()document.width, document.heightimage.width, image.heightgetClientRects(), getBoundingClientRect()getPropertyCSSValue() innerText
![Page 132: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/132.jpg)
![Page 133: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/133.jpg)
![Page 134: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/134.jpg)
Forcing Layout in a Loop
for (...) {totalHeight += currElement.offsetHeight;...currElement.style.top = totalHeight + 'px';
}
![Page 135: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/135.jpg)
Forcing Layout in a Loop
for (...) {totalHeight += currElement.offsetHeight;...currElement.style.top = totalHeight + 'px';
}
![Page 136: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/136.jpg)
Forcing Layout in a Loop
for (...) {totalHeight += currElement.offsetHeight;...currElement.style.top = totalHeight + 'px';
}
![Page 137: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/137.jpg)
Forcing Layout in a Loop
for (...) {totalHeight += currElement.offsetHeight;...currElement.style.top = totalHeight + 'px';
}
![Page 138: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/138.jpg)
Too Much Painting
![Page 139: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/139.jpg)
Too Much Painting
![Page 140: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/140.jpg)
Too Much Painting
![Page 141: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/141.jpg)
Too Much Painting
•Animated images■ Don’t leave “loading” animated GIFs in the background-image style
![Page 142: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/142.jpg)
Too Much Painting
•Animated images■ Don’t leave “loading” animated GIFs in the background-image style
• Even if they are not visible in the window
![Page 143: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/143.jpg)
![Page 144: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/144.jpg)
![Page 145: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/145.jpg)
Use the Right Tool for the Job
![Page 146: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/146.jpg)
Use the Right Tool for the Job
•Animation
![Page 147: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/147.jpg)
Use the Right Tool for the Job
•Animation■ CSS Transitions and Animations
![Page 148: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/148.jpg)
Use the Right Tool for the Job
•Animation■ CSS Transitions and Animations■ requestAnimationFrame()
![Page 149: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/149.jpg)
Use the Right Tool for the Job
•Animation■ CSS Transitions and Animations■ requestAnimationFrame()
• Responsive layouts
![Page 150: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/150.jpg)
Use the Right Tool for the Job
•Animation■ CSS Transitions and Animations■ requestAnimationFrame()
• Responsive layouts■ CSS Media Queries
![Page 151: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/151.jpg)
Use the Right Tool for the Job
•Animation■ CSS Transitions and Animations■ requestAnimationFrame()
• Responsive layouts■ CSS Media Queries■ CSS Flexible Boxes
![Page 152: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/152.jpg)
Use the Right Tool for the Job
•Animation■ CSS Transitions and Animations■ requestAnimationFrame()
• Responsive layouts■ CSS Media Queries■ CSS Flexible Boxes
• CSS calc()
![Page 153: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/153.jpg)
Safari Extensions
![Page 154: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/154.jpg)
Safari Extensions
• Efficiency even more important
![Page 155: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/155.jpg)
Safari Extensions
• Efficiency even more important■ Scripts can be injected into every page
![Page 156: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/156.jpg)
Safari Extensions
• Efficiency even more important■ Scripts can be injected into every page
•Use Page Visibility
![Page 157: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/157.jpg)
Safari Extensions
• Efficiency even more important■ Scripts can be injected into every page
•Use Page Visibility■ Avoid doing work in hidden pages
![Page 158: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/158.jpg)
Safari Extensions
• Efficiency even more important■ Scripts can be injected into every page
•Use Page Visibility■ Avoid doing work in hidden pages■ Only show UI for visible pages
![Page 159: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/159.jpg)
Safari Responsive Scrolling
![Page 160: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/160.jpg)
People Love to Scroll
![Page 161: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/161.jpg)
Legacy Scrolling
![Page 162: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/162.jpg)
Legacy Scrolling
• Every scroll requires painting
![Page 163: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/163.jpg)
Legacy Scrolling
• Every scroll requires painting• Scrolling happens synchronously
![Page 164: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/164.jpg)
Legacy Scrolling
• Every scroll requires painting• Scrolling happens synchronously•Webpage can interfere with scrolling
![Page 165: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/165.jpg)
Safari Responsive Scrolling
![Page 166: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/166.jpg)
Safari Responsive Scrolling
![Page 167: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/167.jpg)
Safari Responsive Scrolling
[layer setPosition:]
![Page 168: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/168.jpg)
Safari Responsive Scrolling
![Page 169: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/169.jpg)
Safari Responsive Scrolling
![Page 170: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/170.jpg)
Safari Responsive Scrolling
![Page 171: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/171.jpg)
Safari Responsive Scrolling
Layout Paint Layout Paint
Safari
Web Content Process
Main Thread
Event Thread
Scrolling Thread
Main Thread
Threading model
![Page 172: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/172.jpg)
Safari Responsive Scrolling
Layout Paint Layout Paint
Safari
Web Content Process
Main Thread
Event Thread
Scrolling Thread
Main Thread
[layer setPosition:]
Threading model
![Page 173: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/173.jpg)
Special Scrolling Behaviors
![Page 174: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/174.jpg)
Special Scrolling Behaviors
• Fixed position
![Page 175: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/175.jpg)
Special Scrolling Behaviors
• Fixed position■ position:fixed
![Page 176: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/176.jpg)
Fixed Position
![Page 177: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/177.jpg)
Fixed Position
![Page 178: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/178.jpg)
Fixed Position
![Page 179: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/179.jpg)
#social-links {position: fixed;right: 0;top: 50px;
}
Fixed Position
![Page 180: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/180.jpg)
Fixed Position
#social-links {position: fixed;right: 0;top: 50px;
}
![Page 181: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/181.jpg)
Fixed Position
#social-links {position: fixed;right: 0;top: 50px;
}
![Page 182: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/182.jpg)
Special Scrolling Behaviors
• Fixed position■ position:fixed
![Page 183: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/183.jpg)
Special Scrolling Behaviors
• Fixed position■ position:fixed
• Fixed backgrounds
![Page 184: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/184.jpg)
Special Scrolling Behaviors
• Fixed position■ position:fixed
• Fixed backgrounds■ background-attachment:fixed
![Page 185: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/185.jpg)
Fixed Backgrounds
![Page 186: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/186.jpg)
body {background-image:url('beach.jpg)';
}
Fixed Backgrounds
![Page 187: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/187.jpg)
Fixed Backgrounds
body {background-image:url('beach.jpg)';
background-attachment: fixed;
}
![Page 188: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/188.jpg)
body {background-image:url('beach.jpg)';
}
Fixed Backgrounds
body {background-image:url('beach.jpg)';
background-attachment: fixed;
}
![Page 189: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/189.jpg)
body {background-image:url('beach.jpg)';
}
Fixed Backgrounds
body {background-image:url('beach.jpg)';
background-attachment: fixed;
}
![Page 190: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/190.jpg)
body {background-image:url('beach.jpg)';
}
Fixed Backgrounds
body {background-image:url('beach.jpg)';
background-attachment: fixed;
}
![Page 191: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/191.jpg)
Fixed Backgrounds
![Page 192: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/192.jpg)
•Only use on the page background
Fixed Backgrounds
![Page 193: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/193.jpg)
•Only use on the page background■ On <html> or <body>
Fixed Backgrounds
![Page 194: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/194.jpg)
•Only use on the page background■ On <html> or <body>■ Backgrounds on just one or the other, not both
Fixed Backgrounds
![Page 195: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/195.jpg)
•Only use on the page background■ On <html> or <body>■ Backgrounds on just one or the other, not both
Fixed Backgrounds
![Page 196: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/196.jpg)
Fixed BackgroundsCSS 2.1
![Page 197: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/197.jpg)
Fixed BackgroundsCSS 2.1
![Page 198: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/198.jpg)
Responsive Scrolling and Scroll Events
![Page 199: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/199.jpg)
Responsive Scrolling and Scroll Events
• Scroll events are asynchronous
![Page 200: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/200.jpg)
Responsive Scrolling and Scroll Events
• Scroll events are asynchronous• But often used for sticky behavior
![Page 201: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/201.jpg)
![Page 202: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/202.jpg)
![Page 203: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/203.jpg)
![Page 204: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/204.jpg)
![Page 205: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/205.jpg)
Special Scrolling Behaviors
• Fixed position■ position:fixed
• Fixed backgrounds■ background-attachment:fixed
![Page 206: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/206.jpg)
Special Scrolling Behaviors
• Fixed position■ position:fixed
• Fixed backgrounds■ background-attachment:fixed
• Sticky position
![Page 207: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/207.jpg)
Sticky Position
![Page 208: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/208.jpg)
Sticky Position
• CSS value:■ position:-webkit-sticky
![Page 209: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/209.jpg)
Sticky Position
• CSS value:■ position:-webkit-sticky
•Use for an element which:■ Takes up space■ Stays in the viewport or scrollable ancestor
![Page 210: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/210.jpg)
Sticky Position
• In-flow positioned■ Like position:relative
Sticky
![Page 211: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/211.jpg)
Sticky Position
• Constrained by viewport■ Like position:fixed
Sticky
![Page 212: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/212.jpg)
Sticky Position
• Constrained bycontaining block
Sticky
![Page 213: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/213.jpg)
Sticky Position
• Constrained bycontaining block
Sticky
![Page 214: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/214.jpg)
Sticky Position
![Page 215: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/215.jpg)
Sticky Position
#side-box {position: -webkit-sticky;top: 10px;
}
![Page 216: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/216.jpg)
Sticky Position
#side-box {position: -webkit-sticky;top: 10px;
}
![Page 217: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/217.jpg)
Sticky Position
#side-box {position: -webkit-sticky;top: 10px;
}
![Page 218: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/218.jpg)
Sticky Position
#side-box {position: -webkit-sticky;top: 10px;
}
![Page 219: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/219.jpg)
Sticky Position
#side-box {position: -webkit-sticky;top: 10px;
}
![Page 220: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/220.jpg)
Sticky Position
Safari 6.1 Safari 7 iOS7
![Page 221: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/221.jpg)
What You Should Do
![Page 222: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/222.jpg)
What You Should Do
• Fixed backgrounds
![Page 223: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/223.jpg)
What You Should Do
• Fixed backgrounds■ Use only on <body>
![Page 224: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/224.jpg)
What You Should Do
• Fixed backgrounds■ Use only on <body>
• Event handlers
![Page 225: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/225.jpg)
What You Should Do
• Fixed backgrounds■ Use only on <body>
• Event handlers■ Avoid mousewheel handlers
![Page 226: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/226.jpg)
What You Should Do
• Fixed backgrounds■ Use only on <body>
• Event handlers■ Avoid mousewheel handlers■ Reduce dependence on scroll events
![Page 227: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/227.jpg)
What You Should Do
• Fixed backgrounds■ Use only on <body>
• Event handlers■ Avoid mousewheel handlers■ Reduce dependence on scroll events
■ Use position:-webkit-sticky
![Page 228: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/228.jpg)
What You Should Do
• Fixed backgrounds■ Use only on <body>
• Event handlers■ Avoid mousewheel handlers■ Reduce dependence on scroll events
■ Use position:-webkit-sticky
•Don’t rely on overflow:scroll, <frame> or <iframe>
![Page 229: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/229.jpg)
DemoFast scrolling, sticky position
Tim HortonSafari and WebKit Engineer
![Page 230: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/230.jpg)
Safari Responsive Scrolling
![Page 231: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/231.jpg)
Summary
![Page 232: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/232.jpg)
Summary
![Page 233: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/233.jpg)
Summary
• Safari■ App Nap for Safari tabs■ Power Saver■ Responsive scrolling
![Page 234: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/234.jpg)
Summary
• Safari■ App Nap for Safari tabs■ Power Saver■ Responsive scrolling
•Webpages■ Reduce work in background pages■ Make power-efficient web content■ Get responsive scrolling
![Page 235: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/235.jpg)
More Information
John GeleynseDirector, Technology [email protected]
DocumentationSafari Dev CenterSafari Extensions Development Guidehttps://developer.apple.com/devcenter/safari/
Apple Developer Forumshttp://devforums.apple.com
![Page 236: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/236.jpg)
Related Sessions
What’s New in Safari and WebKit for Web Developers MissionTuesday 9:00AM
Maximizing Battery Life on OS X MissionTuesday 11:30AM
Improving Power Efficiency with App Nap Pacific HeightsWednesday 10:15AM
Getting to Know Web Inspector Russian HillTuesday 10:15AM
Getting the Most Out of Web Inspector Russian HillTuesday 11:30AM
![Page 237: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/237.jpg)
Labs
Web Content Optimization Lab Media Lab AWednesday 10:15AM
Safari and WebKit Open Lab Media Lab AThursday 9:00AM
Safari and Web Tools Lab Media Lab AFriday 2:00PM
Web Content Optimization Lab Media Lab AThursday 12:45AM
Safari and WebKit Open Lab Media Lab AFriday 9:00AM
![Page 238: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/238.jpg)
Labs
Web Content Optimization Lab Media Lab AWednesday 10:15AM
Safari and WebKit Open Lab Media Lab AThursday 9:00AM
Safari and Web Tools Lab Media Lab AFriday 2:00PM
Web Content Optimization Lab Media Lab AThursday 12:45AM
Safari and WebKit Open Lab Media Lab AFriday 9:00AM
![Page 239: Power and Performance€¦ · 35% Reduction In CPU Power Usage Testing conducted by Apple in June 2013 using production 1.8GHz Intel Core i5-based 13-inch MacBook Air systems with](https://reader035.vdocuments.us/reader035/viewer/2022062919/5edfcaf8ad6a402d666b19f9/html5/thumbnails/239.jpg)