- [Instructor] Performance has become a key metric
for the success of websites and apps.
So much, in fact, Google uses performance metrics
to rank sites in their search engine.
Poorly performing sites get lower ranking.
But search engine preference is not the main reason
you should focus on performance.
The end user, the human beings visiting your website,
is the real reason.
Almost all performance optimizations
and best practices center around either reducing the size
of data sent to the user, or speeding up the user experience
by simplifying tasks and improving code quality.
Both of these reasons have to do with our duty of care
to the end user.
All we know about the person visiting our site
or app is that they want to interact with it.
We don't know where they are, what type of connection
or device or software they're using,
or anything else about them.
Providing each of these people
with the most optimized performance possible ensures
they get the information or interaction
they're looking for with the least amount of time spent,
with the least friction,
and with the least impact on whatever slow connection
or data caps they are working under.
I like to think of web performance like car performance,
while it's technically possible to build a car
out of concrete and steel and lead
and tow a giant grand piano behind it,
its performance would be awful because of the weight,
and the user would pay for that poor performance
every time they fueled up.
This is one reason why cars are made as light as possible
unless there's a specific reason not to.
A pickup, for example, might be designed
for towing heavy loads, so it will be heavier
because there's a reason to make it heavier.
On the web, we often accidentally make our websites out
of the code version of concrete and steel and lead.
Huge images, unoptimized script,
and uncompressed code bundles.
And that's because they work fine
on our computers in our own development environments,
so they should work fine on the web as well.
But the price for this lack of performance is paid
by the end user.
Performance optimizations and best practices
ensure we build our sites as light and nimble as possible
so the user gets the best user experience possible.
And as a bonus, our sites get better ranking on Google
and good user experience improves
what we call organic sharing,
meaning people enjoying using our sites
and then telling other people about it.
In short, good performance is better for your visitors,
better for you because you don't have to pay
as much for your hosting,
better for your Google rankings,
and finally, better for the environment.