⚡ Bolt: Offload lightbox image decoding from main thread#49
Conversation
💡 What: Added `decoding="async"` to the dynamically created image element in `js/lightbox.js`. 🎯 Why: When a high-resolution image is loaded into the lightbox, synchronous decoding can block the main thread, causing jank in the UI or animations. This optimization ensures decoding happens off the main thread. 📊 Impact: Reduces main-thread blocking time when viewing large images in the lightbox, improving responsiveness. 🔬 Measurement: Verify by opening a large image in the lightbox using Chrome DevTools Performance tab and observing reduced "Image Decode" time on the main thread. Co-authored-by: ImChong <74563097+ImChong@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
💡 What: Added
decoding="async"to the dynamically created image element injs/lightbox.js.🎯 Why: When a high-resolution image is loaded into the lightbox, synchronous decoding can block the main thread, causing jank in the UI or animations. This optimization ensures decoding happens off the main thread.
📊 Impact: Reduces main-thread blocking time when viewing large images in the lightbox, improving responsiveness.
🔬 Measurement: Verify by opening a large image in the lightbox using Chrome DevTools Performance tab and observing reduced "Image Decode" time on the main thread.
PR created automatically by Jules for task 11312640668267203817 started by @ImChong