JavaScript performance beyond bundle size. There’s an old story about a drunk trying to find his keys in the streetlight.
Why? Well, because that’s where it’s the brightest. It’s a funny story, but also relatable, because as humans we all tend to take the path of least resistance. I think we have the same problem in the web performance community. There’s a huge focus recently on JavaScript bundle size: how big are your dependencies? That’s not to say that bundle size isn’t important! Parse/compile timeExecution timePower usageMemory usageDisk usage A JavaScript dependency can affect all of these metrics. Bundle size When talking about the size of JavaScript code, you have to be precise. This may sound like hair-splitting, but the distinction actually matters, especially between compressed and uncompressed size.
The most important thing, though, is to be consistent. Bundlephobia For me, Bundlephobia is the Swiss Army knife of bundle size analysis. Now that said, there are some caveats with Bundlephobia: BundlePhobia ❘ cost of adding a npm package. How To Correctly Measure Your Website's Page Load Time. Updated on December 10, 2018.
When assessing the effectiveness of WP Rocket or any other WordPress caching plugin, it’s important that you are able to correctly measure the page loading time of your website. There are several tools available for this. One of the most valid, which provides the easiest way to understand results at a glance, is Pingdom Tools. How To Use Pingdom Click ”Test From” and choose the location closest to your web server, not your own physical location. Pingdom will summarize your web page performance at the top with 4 metrics: Performance gradeRequestsLoad timePage size Of these metrics, the most important is load time! The grade is a general guideline of how well your site is optimized, but it’s not important to get a perfect score there.
The speed at which your site loads is really the only number that matters. Getting An Accurate Average You should run the test several times to get an average loading time since it will not be identical every time. Benchmarking. Why you Shouldn’t Care About Google PageSpeed Insights. The Low Hanging Fruit of Web Performance - The Media Temple Blog.
There is so much to know about making websites fast.
It’s rather incredible. Things like understanding servers and networks, how browsers parse things and make decisions, efficient coding choices, and file format nuances make being a performance expert a full-time career in itself. But you don’t have to be an expert to care about web performance nor be an expert to start making changes to your websites to make them faster. Even total beginners to the web industry have the power to make significant performance increases to the sites they work on. Perhaps you’ve heard this one? If you save the length of an array first rather than calculating on each iteration of a for loop, it’s faster: // this is faster var l = arr.length; for (var x = 0; x < l; x++) { dosmth = arr[x]; } // than this for (var x = 0; x < arr.length; x++) { dosmth = arr[x]; } That’s exactly what I’m not talking about.
I want to talk about low hanging fruit. I have some of my own ideas. 1) Reduce Requests 2) Optimize Assets. Website speed test. Placeholder text for HTML mockups and templates. Optimiser les images. Brève introduction Pourquoi cette page ?
Les pages trop lourde, c'est ennuyeux et on a tendance à les zapper. Quoi de plus con qu'une petite page avec une image de fond de 3Mo ? Réduire la poids des pages web permet : d'accélérer le chargement des pages pour les internautes d'économiser de l'espace disque chez votre hébergeur si celui ci est limité d'économiser de la bande passante Alors comment accélérer ses pages ? Il n'est pas évident de gagner de la vitesse en optimisant le code html. Je vous expliquerais ici comment réduire intelligemment le poids des images sans perdre trop en qualité. Ce tutoriel utilise les logiciels Pngnq, Optipng et jpegoptim. Pour les images de type image/jpeg j'utilise the GIMP disponible gratuitement pour tous les systèmes.
Sous Linux, si les logiciels cités ne sont pas installés, référez vous à la documentation de votre distribution pour les installer. Réduisez votre temps de chargement pour améliorer l’UX. Le succès d’un site et d’une expérience réussie dépend de nombreux facteurs tels que du contenu de qualité, un design plaisant, la facilité de navigation, etc… mais n’oubliez pas que la vitesse de chargement est aussi un élément essentiel.
Il y a énormément de choses à dire sur l’optimisation du chargement d’une page et je vais tacher de rester succinct mais il me semble indispensable de commencer par quelques chiffres qui en disent long sur l’impact du temps de chargement sur l’utilisateur. L’impact du chargement sur l’expérience utilisateur L’utilisateur est un pokémon impatient et hargneux, il n’aime pas attendre et s’attend à trouver son information ou son expérience immédiatement. En 1999 – à une époque où vos doigts de bébé étaient peut-être encore trop boudinets pour tenir un clavier – le temps de chargement idéal d’une page web était estimé à 8 secondes. Huit longues secondes. Yellow Lab Tools. Website Speed and Performance Optimization. PageSpeed Insights.