Learning Objectives ๐ฏ
- Learn how to load and analyze performance recordings ๐
- Understand performance annotations and their meanings ๐
- Practice identifying performance issues through annotations โ ๏ธ
Exercise Instructions ๐
- Download the sample performance recording ๐พ
- Open Chrome DevTools (F12) and go to the Performance panel ๐ ๏ธ
- Load the recording by clicking the "Load profile..." button ๐
- Analyze the annotations in the recording ๐ฌ
- Try to fix the performance issues in the code below ๐ง
Sample Problem ๐งช
Below is a button that when clicked, performs some expensive calculations and DOM manipulations. The performance recording contains annotations highlighting the issues.
Common Annotations You Might See ๐ก
- Long Task โฑ๏ธ: JavaScript execution blocking the main thread for >50ms
- Layout Shift ๐: Elements moving around after initial render
- Forced Reflow ๐: Layout calculations forced by JavaScript
- Heavy DOM Manipulation ๐๏ธ: Excessive DOM operations