I interviewed OpenAI's GPT-3 on how to measure and improve website performance.
This article contains the interview, additional performance tips from GPT-3, and a guide to using GPT-3 on AIDungeon. I added notes to the interview when I thought GPT-3 got something wrong.
Performance optimizations that aren't used often enough
I kept regenerating the answer to the last question. Here are a few more performance tips from GPT-3
General performance tips
- The best optimization you can do is to minimize the amount of code you need to write. The less code you have, the less potential problems it can have, and the faster it will be.
- The best way to see if your website is fast enough is to just load it and see how it feels. If it doesn't feel fast enough, you can make adjustments until it does.
- Probably the single best thing you can do to improve page load times is implement a CDN. While it requires setting up, it has a huge effect on your site's performance.
- People don't take advantage of transfer encoding. Transfer encoding is used to compress the data that's being sent, which allows for more information to be transferred in a given amount of time.
- Using data URIs instead of embedding images is a very easy way to increase performance, but not many people know about it.
- Using vector images (like SVG) instead of bitmap images (like PNG) as they're typically smaller in size and faster to render.
- Using spritesheets to load icons is a great way to decrease the number of HTTP requests that your page needs, as well as reducing the amount of time that it takes for the user to download everything.
My understanding is that with HTTP/2 reducing the number of requests isn't as important any more, so I'd personally avoid spritesheets.
- Minification is the process of compressing your code so it requires less bytes to send to the browser. This reduces the amount of data that has to be transferred over the network and speeds up load time.
Using GPT-3 on AIDungeon
I used AIDungeon to generate the interview, as the OpenAI API is currently invite-only.
To use GPT-3 you need a Pro account, which costs \$10/mo. Otherwise AIDungeon will use GPT-2. After upgrading you need to change to the Dragon model in the settings.
Next, start a single-player game and choose the "custom" option.
You now need to provide a prompt. This is the prompt I used:
You're a web developer trying to improve the performance of your website. You talk to a colleague about front-end performance metrics, how to speed up your site, and how to measure and improve performance.
You say "Can you explain what the First Contentful Paint measures?"
"The First Contentful Paint measures when content first starts rendering on a web page. This means the user has something to look at, usually text or an image."
You say "Can you tell me a bit about why web performance is important?"
If things go well you'll get a good answer right away. In this example GPT-3 doesn't quite understand the interview format yet, so you get the narrative bit where you "go back to work".
You can either click the reload button generate a new response, or edit the existing response and remove the last sentence.
Sometimes AIDungeon said the AI doesn't know what to say. In those cases I just repeated the question and usually got an answer.