So there is a Chrome developer tools MCP, which if you install, it can do anything that you can do in that UI. It can click through your page, record performance traces, and analyze for them. And the most important thing that AI can do is to flatten the learning curve. So it used to be that you needed to be an expert to get results. Now you can basically start doing this and get AI to take you through the process and learn as you go. So if there's only two things that you take away from this, I want it to be these two things. First of all, in order for all of this to work, you have to install the Chrome developer tools MCP. Without that, Claude doesn't know what it doesn't know. It won't recommend that you do this, it'll just be ignorant. So you need to do that yourself. And then my big suggestion is, ask the AI what your options are. Don't say fix this performance problem, don't even say why is it slow, say explain to me my options. And that's how you become an expert. And that's how you learn and build up a toolbox of techniques.
So I'm going to show you a few of these techniques now. Again, we're just going to be going through them quite quickly. But the idea is to show you what's possible and just remember anything in here, you can get AI to explain to you and then do it next week. So the first is a regression bisection. So a regression is a special case of a performance problem where you have a version of your application that you know is good and a version that you know is bad. And you can automatically find out exactly, like you can ask Claude, find the commit that introduced this issue and it will do a thing called a git bisection for you. So if you know 50 commits ago, your app was good, now it has this problem, you can say find the commit that introduced it and it will check out a commit in the middle and test it, as in it will check out the source code, build your application, open it, start the dev server, open it in Chrome, navigate to the page, do the action that you told it was slow, record the performance profile, find out whether or not it's slow, really time consuming stuff. And let's say, OK, we figured out commit 25 was good, so it will repeat the process again and it will go systematically through your whole commit history to find out the exact commit. And I've gone away from a lunch break where I had this doing it for an hour and I came back and it's like, hey, this commit, that's your problem. So another technique I use all the time is a standalone reproduction. So here's the page I showed you earlier that recorded a performance trace from. If I was interested in the resized performance of that grid, there's a whole bunch of other stuff up there that's just noise that's going to pollute the trace. So you can tell Claude, hey, here's a page I'm interested in, just make a standalone version of that that just has the grid. And I asked it to do that and it built this. Now if we're interested in the resized performance, you can make this little button here where you have a little button that just resizes the grid five times. If you record a performance trace while you're doing that, you'll get really clean data.
Comments