How do you measure a website's speed? With a Lighthouse score? Server response time? Or how fast a database query finishes?
As engineers, these metrics are our bible. However, there is a fact we often forget: Users don't carry stopwatches.
A user doesn't know if an API response took 200 milliseconds or 400 milliseconds. All they know is the fluidity they feel when they click a button on the screen. This is where the finest art of modern Frontend development comes into play: Perceived Performance.
1. The Psychology of Waiting: Skeleton Screens vs. Spinning Wheels
In the past, we used to place a spinning wheel (spinner) in the center of the screen while data was loading. Technically, this tells the user, "Wait, I'm working." But psychologically, it sends the message, "I'm not done, I have nothing to show you," making the wait feel longer than it actually is.
In the projects I develop today, I prefer the "Skeleton Loading" structure. Even if the content hasn't arrived yet, by instantly showing the page's template, we signal to the brain, "Loading is complete, just the text is coming." This small illusion reduces waiting stress and significantly lowers bounce rates.
2. Predicting the Future: Optimistic UI
Have you ever noticed on Instagram that when you like a photo, the heart turns red instantly, even if your internet is disconnected?
We call this Optimistic UI. When a user takes an action (clicks a button or submits a form), we update the interface without waiting for a "success" response from the server. We give the user the feeling that their task is done while communicating with the server in the background.
What if an error occurs? We politely notify the user and revert the change. However, in 99% of cases, no error occurs, and the user thinks your site works at the speed of light.
"Speed is not just the transfer time of bytes; speed is ensuring the user's mental flow remains uninterrupted."
3. What Does Google Say? (CLS and Visual Stability)
Another enemy of perceived performance is elements shifting after the page loads (Cumulative Layout Shift). Having an ad load late and push a button down just as the user is about to click it is not only a bad experience but also a mistake that destroys your SEO score (Core Web Vitals).
When establishing frontend architecture, reserving the space that images and blocks will occupy in advance (aspect-ratio boxes) satisfies both Google bots and the user's visual comfort.
Conclusion: Engineering Begins with Empathy
Code is compiled for machines, but written for people. You can write perfectly clean code or build a magnificent database architecture. But at the end of the day, what determines your success is how "in control" the user feels during those few seconds spent in front of the screen.
True performance is the ability to blend technology with human psychology.