Jai's Web blog - Supercharged

Chrome for Developers · Advanced ·📰 AI News & Updates ·10y ago

Key Takeaways

Analyzes and improves the performance of a UI engineer's website, Jai's Web blog

Full Transcript

[Music] hello and welcome to supercharged I am Paul this is the show where I take the websites that you've submitted and I go through them and I look for performance issues and I try and figure out what they are and how we can do a better job so today I have J's web blog uh he's a UI engineer at flipcart and an X yoan and when I saw this site I thought there's an interesting thing here not the page load which we normally do but actually this side menu caught my attention because I thought that juns a little bit when it comes out on a desktop and I wonder if it's just doing something a little bit funny and uh what it would look like on a mobile device so what we're going to do is we're going to hit Chrome inspect like so I have my Nexus device my Nexus 5 here plugged in and what I can do is I can go and grab this URL and I can pop it in here and say open and it opens a new tab on here which is magical and wonderful and it's going to load up and I can do inspect and it brings up Chrome's Dev tools as we know and love so oh good and that means that I can inspect what's going on on the phone in just the same way as I would on desktop except that I also get this additional feature which actually shows me what's on the device so if I click on this it actually happens on the phone or I can click on here and it happens on the screen it's magical love that even looking at what's on the phone I can tell you that this animation isn't running at 60 frames a second let's give ourselves a baseline we're in the timeline so what we'll do is we'll hit the record button like so and I will hit that button over there on the phone and you can see yeah goodness okay so it's just about 60 frames a second sometimes and towards the end there it's shooting off the top um this Riz is what's that 72 milliseconds I'm holding shift here as I click drag and that gives me a time range so 72 milliseconds for an animation like this we want to be 16 so what's that that's well about four five times so I about 10 12 frames a second roughly let's figure out why we're doing an animation that's so slow right the way to do this let's switch off the device bit actually no let's leave it on why not we're all friends here um ah okay so the straight away actually on the body there is a class of nav open which feels like it's something that's relevant to our interests yes okay margin left now I know from other work that if you do something like margin left there we go margin left changing margin left is going to trigger layout it's going to trigger paint and it's going to trigger composite all three tasks are quite expensive for us to do during an animation what we want to do is if we're animating we want to just stick to composite operations so we can do that with just by using say a transform and in this case a transform with a whole body would actually work really well rather than using margin left so what I'm going to do is I'm going to go back and check out CSS trigger. comom I mean I built it so I'm going to you know promote it but still pretty cool anyway let's have a look we have Dev have tools open still so rather than margin left what do we say we're going to do a transform and let's translate X 15.75 em we have a transition which we're going to change from margin to transform trans form there we go there is a the webkit version here and the mo and O so you could do the vend of prefix version as well if you we're doing something similar to this and let's see now if we switch on show P rectangles so with that in place does that work oh it's still painting ah what we need to do what we should do is since we're are doing a transform we should tell Chrome in this casee that we will we'll be changing the transform of the elements in question so that there's a green flash there which tells us that it's just promoted something to its own layer I guess so now if we actually leave the show paint rectangles on yeah there's a a green flash where the button was which makes sense because it's probably got a selected State and now let's go back to timeline let's record again there we go we've gone from 10 12 frames a second in some places to 60 there's a little bit of a a a jump there which may or may not be something depending on how we did but you can see that we've we've hit 60 frames a second we're in a really good spot um instead of animating uh margin left or any of the properties that would trigger layout and paint you just want to stick to things like transform and opacity where we can for animations and certainly in this case we definitely can and by doing that we've gone from you know 30 frames second is all the way up to 60 so take a look at your animations uh see if there's opportunities to switch out those kind of expensive operations for the uh the easier cheaper ones and uh hopefully you'll get a good performance boost there too don't forget to subscribe and I'll catch you next time some mornings I get out of bed and I'm just Paul some days I am Paul Master of the performance King of the timeline oh

Original Description

Supercharged: Jai is a UI engineer at FlipKart, and his site has a neat sidenav, but are there ways to improve its performance? Paul takes a look. Don't forget you can submit your own site here: https://services.google.com/fb/forms/web Subscribe to the Google Chrome Developers Channel! http://goo.gl/LLLNvf
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Chrome for Developers · Chrome for Developers · 23 of 60

1 Polymer Performance Patterns (The Polymer Summit 2015)
Polymer Performance Patterns (The Polymer Summit 2015)
Chrome for Developers
2 Polymer Power Tools (The Polymer Summit 2015)
Polymer Power Tools (The Polymer Summit 2015)
Chrome for Developers
3 Chrome Dev Summit 2014 – Chrome Case Studies
Chrome Dev Summit 2014 – Chrome Case Studies
Chrome for Developers
4 Web Directions Code 2015 round up
Web Directions Code 2015 round up
Chrome for Developers
5 Maintainable Code - HTTP203
Maintainable Code - HTTP203
Chrome for Developers
6 iron-ajax… wat?! -- Polycasts #26
iron-ajax… wat?! -- Polycasts #26
Chrome for Developers
7 The Guardian - Supercharged
The Guardian - Supercharged
Chrome for Developers
8 ES2015 (next version of JavaScript), Totally Tooling Tips (S2 Ep1)
ES2015 (next version of JavaScript), Totally Tooling Tips (S2 Ep1)
Chrome for Developers
9 #AskPolymer: Rob answers all the questions ever -- Polycasts #27
#AskPolymer: Rob answers all the questions ever -- Polycasts #27
Chrome for Developers
10 The Future of JavaScript - HTTP203
The Future of JavaScript - HTTP203
Chrome for Developers
11 Data Binding 101 -- Polycasts #28
Data Binding 101 -- Polycasts #28
Chrome for Developers
12 The Guardian part 2 - Supercharged
The Guardian part 2 - Supercharged
Chrome for Developers
13 The Future of Web Audio: with Chris Wilson and Chris Lowis
The Future of Web Audio: with Chris Wilson and Chris Lowis
Chrome for Developers
14 Chrome 46: New motion-path animations, client hints and service worker improvements
Chrome 46: New motion-path animations, client hints and service worker improvements
Chrome for Developers
15 Sublime Snippets, Totally Tooling Tips (S2 Ep2)
Sublime Snippets, Totally Tooling Tips (S2 Ep2)
Chrome for Developers
16 #AskPolymer: How do you make the show? -- Polycasts #29
#AskPolymer: How do you make the show? -- Polycasts #29
Chrome for Developers
17 Critical Path CSS, Totally Tooling Tips (S2 Mini Tip #1)
Critical Path CSS, Totally Tooling Tips (S2 Mini Tip #1)
Chrome for Developers
18 Binding to Objects -- Polycasts #30
Binding to Objects -- Polycasts #30
Chrome for Developers
19 Player FM - Supercharged
Player FM - Supercharged
Chrome for Developers
20 Where’s the Designer? #AskPolymer -- Polycasts #31
Where’s the Designer? #AskPolymer -- Polycasts #31
Chrome for Developers
21 Jake Beats Wikipedia - HTTP203
Jake Beats Wikipedia - HTTP203
Chrome for Developers
22 Supercharged Observers! -- Polycasts #32
Supercharged Observers! -- Polycasts #32
Chrome for Developers
Jai's Web blog - Supercharged
Jai's Web blog - Supercharged
Chrome for Developers
24 Windows Command-line Tooling, Totally Tooling Tips (S2, Ep4)
Windows Command-line Tooling, Totally Tooling Tips (S2, Ep4)
Chrome for Developers
25 What about internationalization? #AskPolymer -- Polycasts #33
What about internationalization? #AskPolymer -- Polycasts #33
Chrome for Developers
26 Developing for Billions (Chrome Dev Summit 2015)
Developing for Billions (Chrome Dev Summit 2015)
Chrome for Developers
27 Google+ Performance Improvement Comparison
Google+ Performance Improvement Comparison
Chrome for Developers
28 Deploying HTTPS: The Green Lock and Beyond (Chrome Dev Summit 2015)
Deploying HTTPS: The Green Lock and Beyond (Chrome Dev Summit 2015)
Chrome for Developers
29 Progressive Web Apps (Chrome Dev Summit 2015)
Progressive Web Apps (Chrome Dev Summit 2015)
Chrome for Developers
30 Instant Loading with Service Workers (Chrome Dev Summit 2015)
Instant Loading with Service Workers (Chrome Dev Summit 2015)
Chrome for Developers
31 Increase Engagement with Web Push Notifications (Chrome Dev Summit 2015)
Increase Engagement with Web Push Notifications (Chrome Dev Summit 2015)
Chrome for Developers
32 Engaging with the Real World: Web Bluetooth and Physical Web (Chrome Dev Summit 2015)
Engaging with the Real World: Web Bluetooth and Physical Web (Chrome Dev Summit 2015)
Chrome for Developers
33 Asking for Permission: respectful, opinionated UI (Chrome Dev Summit 2015)
Asking for Permission: respectful, opinionated UI (Chrome Dev Summit 2015)
Chrome for Developers
34 Polymer - State of the Union (Chrome Dev Summit 2015)
Polymer - State of the Union (Chrome Dev Summit 2015)
Chrome for Developers
35 Building Progressive Web Apps with Polymer (Chrome Dev Summit 2015)
Building Progressive Web Apps with Polymer (Chrome Dev Summit 2015)
Chrome for Developers
36 Introduction to RAIL (Chrome Dev Summit 2015)
Introduction to RAIL (Chrome Dev Summit 2015)
Chrome for Developers
37 DevTools in 2015: Authoring to the max (Chrome Dev Summit 2015)
DevTools in 2015: Authoring to the max (Chrome Dev Summit 2015)
Chrome for Developers
38 RAIL in the real world (Chrome Dev Summit 2015)
RAIL in the real world (Chrome Dev Summit 2015)
Chrome for Developers
39 #ChromeDevSummit talks are up - W00T! -- Polycast #34
#ChromeDevSummit talks are up - W00T! -- Polycast #34
Chrome for Developers
40 V8 Performance from the Driver's Seat (Chrome Dev Summit 2015)
V8 Performance from the Driver's Seat (Chrome Dev Summit 2015)
Chrome for Developers
41 Quantify and improve real-world RAIL (Chrome Dev Summit 2015)
Quantify and improve real-world RAIL (Chrome Dev Summit 2015)
Chrome for Developers
42 Owning your performance: RAIL (Chrome Dev Summit 2015)
Owning your performance: RAIL (Chrome Dev Summit 2015)
Chrome for Developers
43 HTTP/2 101 (Chrome Dev Summit 2015)
HTTP/2 101 (Chrome Dev Summit 2015)
Chrome for Developers
44 Leadership Panel (Chrome Dev Summit 2015)
Leadership Panel (Chrome Dev Summit 2015)
Chrome for Developers
45 Build Processes, Totally Tooling Tips (S2, Ep 5)
Build Processes, Totally Tooling Tips (S2, Ep 5)
Chrome for Developers
46 Accessibility (Chrome Dev Summit 2015)
Accessibility (Chrome Dev Summit 2015)
Chrome for Developers
47 Binding to Arrays -- Polycasts #35
Binding to Arrays -- Polycasts #35
Chrome for Developers
48 HTTP2 - HTTP203
HTTP2 - HTTP203
Chrome for Developers
49 Chrome 47: Splash Screens, requestIdleCallback and better desktop notifications (New in Chrome)
Chrome 47: Splash Screens, requestIdleCallback and better desktop notifications (New in Chrome)
Chrome for Developers
50 Call For Submissions - Supercharged
Call For Submissions - Supercharged
Chrome for Developers
51 Cross Device Testing, Totally Tooling Tips (S2 Ep6)
Cross Device Testing, Totally Tooling Tips (S2 Ep6)
Chrome for Developers
52 Testing AJAX with Web Component Tester -- Polycasts #37
Testing AJAX with Web Component Tester -- Polycasts #37
Chrome for Developers
53 Slack: Extended Xmas Special - Supercharged
Slack: Extended Xmas Special - Supercharged
Chrome for Developers
54 Browser testing with Travis & Sauce Labs -- Polycasts #38
Browser testing with Travis & Sauce Labs -- Polycasts #38
Chrome for Developers
55 Optimize for production with Vulcanize -- Polycasts #39
Optimize for production with Vulcanize -- Polycasts #39
Chrome for Developers
56 Highlights from Chrome Dev Summit 2015
Highlights from Chrome Dev Summit 2015
Chrome for Developers
57 Chrome 48: Custom buttons in notifications, DevTools Security panel, and Presentation mode
Chrome 48: Custom buttons in notifications, DevTools Security panel, and Presentation mode
Chrome for Developers
58 Crisper: Protecting your Polymer app with CSP -- Polycasts #40
Crisper: Protecting your Polymer app with CSP -- Polycasts #40
Chrome for Developers
59 How do I use Sass with Polymer? #AskPolymer -- Polycasts #41
How do I use Sass with Polymer? #AskPolymer -- Polycasts #41
Chrome for Developers
60 Colors – DevTools Tonight #0 (Pilot)
Colors – DevTools Tonight #0 (Pilot)
Chrome for Developers

Related Reads

📰
The Internet Doesn’t Need Another Platform. It Needs a New Constitution.
The internet needs a new constitution that prioritizes ownership, trust, and resilience, incorporating AI principles, to define its next era
Medium · Startup
📰
Apple Is Suing OpenAI for Allegedly Stealing Hardware Secrets
Apple sues OpenAI for allegedly stealing hardware secrets, highlighting the importance of protecting intellectual property in the tech industry
Wired AI
📰
The first flights of the US air-taxi program carried organs, not passengers
The US air-taxi program has completed its first flights, transporting organs instead of passengers, marking a significant step in eVTOL technology
The Next Web AI
📰
“Did You ChatGPT This?”
Explore the impact of AI writing tools like ChatGPT on the writing profession and the authenticity of written content
Medium · ChatGPT
Up next
Higher-Ed GEO & AEO: How AI Picks Sources (with Ray Martinez)
LinkBuilding HQ
Watch →