over 1 year ago Syntax Podcast
Making Your App Feel Faster Than It Really Is
Delay loading indicators if fetch is very quick
Scott Tolinski
like, okay. We get it. I just want the menu to open. And, like, give me give me, two tenths or one tenth second animation on that thing and call it a day. I I don't have time to sit here and wait for your hamburger menu to open. Yeah.
Scott Tolinski
And we're like, yeah. Her bag hasn't come out yet, so we're just waiting, see if there's anything else coming out. Everybody's long gone.
Wes Bos
in between those steps so the user actually knows that that something is actually happening. Yeah. Word. Lastly, I asked on Twitter for some people's tips as well. I thought we'll just go through them and and see what our thoughts are. First one is, Jimmy,
Scott Tolinski
or you're just now in the current state that you're in. Like, if you're using an each loop with some IDs and you update that data in any of the modern frameworks, it's not gonna rerender that thing. So what you'll want to do JS, like, let's say I'm I'm adding something to to to a to do list. I hit enter.
Wes Bos
loader, I often think, And some people I asked on Twitter, like, for some of these tips. Some some people said calculate the mouse trajectory throw of a spinner every single time you change something
Scott Tolinski
of the time. I'd sooner take a spinner
Wes Bos
to get the width and height of your image when you upload it or you're storing in a database or when you're when you're doing a build, you're figuring all of that out.
Wes Bos
On that same point, animation should be, like, cancelable.
Wes Bos
they're firing off or the aspect ratio. They're they're the same thing. Right? how some animations are intentionally very important.
Scott Tolinski
frameworks that, like, take over data loading do this for you.
Scott Tolinski
I am corgi
Scott Tolinski
Another good tip here is preload on Vercel. So you can have an event
Wes Bos
be you can send what you have
Scott Tolinski
and the entire UI is done with eye tracking. So if I want to type in a search bar, I just look at the search bar and start typing.
Scott Tolinski
immediately. And then the the this is called the optimistic UI.
Wes Bos
and I have to wait until the animation finishes and then click it again. Because if I click it too quickly, your server bill. It could be expensive for your extra users.
Scott Tolinski
And the poor guy, I had to I had to go up to him and be like, hey, man. I'm so sorry it was actually that bag. I was like Oh, man.
Wes Bos
can can be longer. But these, like, micro animations,
Scott Tolinski
I got nothing.
Scott Tolinski
it's instantaneous or as fast as it can be, and then everything else happens in the background. It's just wonderful.
Wes Bos
the Every single time I check a box, little tips and tricks that you can do to make your app is
Scott Tolinski
The footer. Oh, oh, yeah. There it is. There it is. Dude, I I I knew exactly what you're going to say. I had this so this experience so many times in the past, whoever knows that. And I go to it, and I'm like, oh, it's the footer.
Scott Tolinski
me, looks better than to load on these pages? What are what are the things? What are the aspects? Where do I even start? Are there errors? Right? You can you can, you know, connect all of those dots together the moment that you click something. Like, the moment I hit enter, The framework, Definitely something that you don't want to take But in reality, like, is, like, one of the default behavior for links is that when you hover over a link, it's preloading that route.
Wes Bos
Alex Vipin says, don't add enter animation to popovers.
Wes Bos
optimistic states. It simply just immediately updates, and then and then the sync engine will will update it in the background. Yeah. And so optimistic UI is kind of like local data lite Wes
Wes Bos
The, like, overhead of of preloading that is is almost nothing.
Scott Tolinski
Yeah. Maybe. Yeah. Because you wanna get it as fast as possible. You want that feedback. You don't want it to go away. Yeah.
Scott Tolinski
in most cases. When you're saying shimmers, he means, like, shimmering skeleton screens. Look at all this content we haven't loaded yet. Look at how it might look. Oh, that's you know, I'm with you. I'm with you guys both on this one. I think this is so true. And especially
Scott Tolinski
I don't think that's I I can't imagine ever needing this kind of thing. I'm sure Checking for security.
Scott Tolinski
Same with the finder or app opening stuff. The only reason it doesn't do that is if you're opening something that's been minimizing. You're min you're unminimizing to me.
Wes Bos
but
Scott Tolinski
But, like, Gatsby was one of the first ones to make this a core part of the experience. And one of the things that people
Wes Bos
janky UI. Right? So much, with streaming,
Scott Tolinski
Can I tell you an embarrassing story? We, went to Mexico for spring break.
Wes Bos
thing spin. You can't you Node? Normally, when you go from a a regular HTML page to another HTML page, you can you can make the browser spin. But when you're using a single page app
Scott Tolinski
you are handling Wes that data change. Right? And and you're but with with local data, you're essentially caching that data on device in a database. So, therefore, even on page refresh, it's going to be instantaneous Beats and potentially have a lot of traffic. So this is what you should be looking at, and then you can further dive into, alright. Well, what exactly is taking
Wes Bos
about our company is the first thing that you see when you click on a tracking link for FedEx.
Scott Tolinski
Totally. Yeah. It's very frustrating. Yeah. Oh, another another thing that Gatsby kind of popularized is that it should be the visual aspect of it should be reversible. Too oftentimes,
Wes Bos
I agree. Yeah. And and just if something takes a long time, you could have, like, a little game for your user to have. Just the perceived speed of something is so important.
Wes Bos
Like, let's say you wanna, like, resize an image. Right? You gotta upload it. You have to,
Wes Bos
it either breaks the entire thing, I have to reload the page, or using a framework that to the browser
Scott Tolinski
occasionally good is if you have large photos or or using photos in your interface.
Scott Tolinski
Many just how fast your app is at any given point. You can assess the user misery score for, how just how fast or slow this thing is for the majority of users. And it gives you a nice little user misery bar to say, hey. These are the pages on your site that are
Wes Bos
which is literally nothing. I'm using FedEx's It's true. Yeah. Okay.
Wes Bos
the width and height of them are, right, And anything else to add there, Scott? display value on that.
Wes Bos
zero to a % of how how something is doing. It's because there's there are steps.
Scott Tolinski
Even like SvelteKit
Wes Bos
And first of all, you should be able to select
Scott Tolinski
Did this is this broken? Is this a wrong link? Is this, like,
Wes Bos
luggage to come in. This This is one of those, like, business textbooks life of that component, to have to try to input multiple loading pages, which could be expensive for your also comes with some some downsides.
Wes Bos
reviews because it took forever for their logo
Scott Tolinski
wild at the time. That was wild at the time. I remember thinking, like, this these are the smartest people on the Sanity, but maybe you could do something like that, like, have a a when you
Wes Bos
wait for the job to start. You gotta actually resize the image, and and then you gotta send it back.
Scott Tolinski
There's nothing more frustrating when it's like a skeleton screen for, like, ten seconds or something like that, and and you're just like, oh, it's so close.
Wes Bos
Yeah. Yeah. Totally. What did I put here? Pixelated spinners. Oh, for some reason What is This is it just
Scott Tolinski
really felt when they used a Gatsby site, like, even in alpha, when Gatsby was in alpha Yeah. Back when I was a user. Because once something goes out of alpha, I'm, I'm over it. That's that's how it works. But,
Wes Bos
and then it brings it back. And and maybe it's gonna change what's available in the sidebar.
Wes Bos
Oh my god. That's kinda interesting. Maybe, like, when you're submitting for two hundred milliseconds after somebody has finished typing, then go ahead and fire it off so they don't have to go grab their mouse and mouse over and click the search button. Word. Another Node, progress loaders that move in between steps. So often, you open up the date input and you click on the back arrow to go back a month.
Wes Bos
think that your skeleton loader is if your spinner is either obnoxious and you're using push state, you're not actually reloading the the page. So you have to show the user that something is happening. So I'm I'm telling you, both show the user that something is happening, but don't show them too quickly because if it is a very fast application, speed is actually really important when you're talking about UI and talking about performance. So we're gonna go through a whole list of things you can do to improve the perceived speed of your
Scott Tolinski
perform the update to the UI
Wes Bos
versus having to, like, wait for a user to actually they should be very, very fast or or even, like, entirely taken off. Like, if you look at a lot of the stuff on on Bos or macOS, The context for it coming in is it's literally in front of you. Right. The context for it going away
Scott Tolinski
Let's talk about an optimistic UI. Optimistic UI is one of these things that can do what we said just a moment ago and make your application,
Scott Tolinski
You know? There was that famous,
Wes Bos
show nothing.
Scott Tolinski
And there's one bag going around on the carousel,
Wes Bos
Only exit animation. See the macOS menu bar and Tailwind Catalyst drop downs.
Wes Bos
any faster. They simply just made the walk to the baggage Yes. Longer.
Scott Tolinski
It's like that's like a Nathan for you thing. It's like
Wes Bos
the opposite, It feels like it should be faster than that.
Wes Bos
Yes. Cool. Alright. Those are our tips. Let us know your tips down below in the comments. Love to hear what you have to say.
Scott Tolinski
sometimes that's really frustrating because it's just like, oh, that wait. This isn't actually loading. Like, it should be.
Wes Bos
probably for most of you, but, like, throwing up a full page spinner on every single change. Yeah. So, like, this especially hits when you're trying to filter products.
Wes Bos
I click on the page. It's it's nice and fast. I have caching. In in production, it's nice and fast. But there are some cases to eye tracking doing things for you when you use that headset for sure. One other super annoying thing that I hate on websites and, like, this is so clear I think it was at Toronto Airport many years ago. They were getting such bad, delay in in firing off a click tap or click those in, I don't know how long, but to show the animation moving
Scott Tolinski
okay. So let's go good, better, best. I think Yeah. Best is the thing loading fast. Good is the blurred thing or background color that then fades the image in. And then bad is nothing, and then your page loads, and then all the content shifts down. Throw that in the trash, because that that's garbage. But, yeah, do do something there for images. They're just images popping in left and right. User goes to click on something. The whole thing moves. Like, yeah. That's that's trash talk. Yeah. And especially if you are the visibility, you know, who's getting a bad experience, why, and fix it because that's ultimately what we're about here. So check it out at century.i0/syntax.
Wes Bos
while you are waiting, it doesn't feel like it is is taking as long. And that's the reason why they put minigames in some of these, custom ranges. But if I wanna select three years' worth of dates, I gotta hit the back arrow 36 times to to go back for three days or for three years. And what happens is I have to click the arrow,
Scott Tolinski
that fire off your API call, whatever that may be.
Scott Tolinski
when you Yarn moving around, switching Windows, there's no animation at all. It simply just Pnpm. Happens. Yeah. You click the finder icon. Finder pops up. And and I think that is a big thing is that animation certainly are great for a number of things, but not everything. I I do like, one of the my big pet peeves is, like, when you have a hamburger menu and you click it and it's like, And if you click something and have to wait a second before the page does something or whatever,
Wes Bos
Govin says,
Scott Tolinski
A blurred low res version of that photo loading first in the exact same spot,
Scott Tolinski
oh, no. It's just loading.
Wes Bos
Look at Yes. The footer.
Wes Bos
it often makes sense to show, like, a loading bar, on the top. Like, I had this with my own website. I developed the whole thing locally.
Wes Bos
we often will show, like, a spinner when something is is being worked on. But in in a lot of cases, yeah, nested drop down menus. And then if you don't
Scott Tolinski
not done correctly.
Wes Bos
that's being held by a guy.
Wes Bos
we're talking about how to make your website feel faster.
Scott Tolinski
that
Wes Bos
what he's saying is make the UI really big so that as the stuff is streaming in, it's not actually on their their screen.
Wes Bos
I don't know. I I could I could see it, right, where it's like, oh, that was too fast. I don't know if it actually did anything. Oh, yeah. Yeah. AKA the fetch request
Scott Tolinski
we were standing at the bear the baggage carousel at the Denver Airport, which does take a while. And
Wes Bos
if you ever wonder how search is so fast on some of these websites,
Wes Bos
that that
Wes Bos
makes you or or you should
Scott Tolinski
a second, half a second, any of that stuff. You know? No. You Node,
Wes Bos
Wes you click on something and nothing happens. And and you you have to provide some sort of, like,
Scott Tolinski
all of our bags, except for Courtney's bag, And it's not like every animation. There's certainly some animations that can be slower or more lethargic
Wes Bos
reverse itself out from there.
Wes Bos
it just doesn't react to to the click as well. So if there is an animation for that. And if that's the case, you should be throwing up like a, oh, you're offline right Node, instead of, like, me having to And those five or six steps might be your progress, Like, you could be unnecessarily mouses down or or touches the screen The browser UI will will take the width and height and make it aspect ratio. But what I'm saying is that
Scott Tolinski
Yeah. For sure.
Wes Bos
Yeah. Yeah. Like like, when you're in, like, a shoddy network environment just telling me that I'm offline. It should be telling me, like, oh, I'm just fetching the data right now. Yeah. Exactly. But that's better than pointer down events or mouse down or touch start events.
Wes Bos
slowed down to build trust. So this is not perceived speed, but it's perceived trust
Scott Tolinski
Work on your app speed. All that stuff, it's important. Don't let you in slow apps be out there. That's all I got. Peace. Peace.
Wes Bos
start with, like, point 1.2.
Scott Tolinski
to
Wes Bos
embedding the width and height or at least the aspect ratio of your images so that when they do load, they don't you don't get content shift, loading indicator that the the page has changed from one to another because you can't make the little browser if you drag your your finger off or if you accidentally touch something just with your finger,
Scott Tolinski
You know, sometimes those things can take a little while.
Scott Tolinski
to to submit something? Oh my gosh. This is these are all unethical life pro tips. That's that's so far for specific aesthetic reasons, but we're talking UI three seconds for all of my transitions and animations. Way too long.
Scott Tolinski
two tenths of a second, probably fine. Yeah.
Wes Bos
And, I agree as well because, otherwise, it's just like, what is in this random space? Yeah. Totally. Search on input instead of search on click. This is Fake it until it's done loading. I don't know what that one means. I thought I'd throw that in there, see if you have any thoughts. I don't. No. I have no idea. I Alright. Again, some of these are just, like, Nathan for you things. These are hilarious.
Scott Tolinski
says, maybe a hot take, but shimmers suck 99% should be Amazon blog post when they showed how they like, they had, like, invisible triangles so that when you're moused off of a drop down menu, oh, are you missing a bag? What you know, whatever.
Scott Tolinski
Yeah. There's so much. Yeah. A guy's walking the computer into the yeah. You Scott opt options, guys. FedEx. You got options. You're known for being the company that put the arrow in the the logo. Like, we're we're attention to detail oriented. We put a logo. We put arrow in our logo. Post on that arrow in your logo. That Keep it going. Yeah. Yeah. Just anything. Crazy.
Wes Bos
Jimmy, v v, says make the UI bigger so more stuff is below the fold and then stream and suspend that in. I thought that was kind of funny because perceived Skirt.
Wes Bos
if it does not need to show like like, basically, you would render out your loader, but in the first hundred millisecond, First one we have here is using a mouse down or probably should be using a pointer down event versus a click. Now this is not always a good idea. Node blanketed. Yeah. Certainly, because you're you're starting a new one. And for a lot of people, it's worth those extra requests
Scott Tolinski
skeletons feel slow now. I'd rather just wait to see any content at all, but I am weird. And then,
Wes Bos
what you can do if you are showing a loader or using, like, a React suspense or something like that, throw a minimum
Scott Tolinski
I swear I looked at it. It was crazy. I I I I don't know if I was just sleep deprived or what. It was I felt so embarrassed.
Wes Bos
Interesting. Maybe this is the beginning of the backlash. Give me a cute loading indicator. You know? Give me the FedEx truck backing up and unloading my, my results.
Wes Bos
a progress loader is not going to give you a very clear
Scott Tolinski
start at the end point of the animation. It should start where you are.
Wes Bos
in flight K. Am I showing anything sensitive? I don't believe so. Alright. Look watch FedEx's website when I open it up.
Wes Bos
rerunning where maybe there's no cache hit or maybe somebody's on a really slow connection
Scott Tolinski
I'm sure there's data to back up that, like, this is actually a thing or that this is actually a good thing for some people.
Wes Bos
you you have like, go ahead and and hit the search button. Or you can even just, like, wait as you're still processing it. And this is especially
Wes Bos
that. Sanity throws up a whole spinner,
Wes Bos
And, whereas, like, you could probably
Scott Tolinski
perform the update to the UI, and then send that information to the server in the background. And then once that information comes back, what you're doing is you're either responding to an error state and saying, oops. Like, something failed and removed the one from the list or whatever,
Wes Bos
makes it a slog
Scott Tolinski
Yeah. You look over here, and I tap my finger, and it clicks on it. So, like, you get really used
Wes Bos
and preload that. So don't do it on hover. Do it when you think they're about to hover on it. And I I don't know of any libraries that do this. So if you put them down below in the comments if you know this. But based on some trigonometry,
Scott Tolinski
and he's like, that's not it. We're like, no. We've already looked at this bag three or four times. It's not it. And the bag just keeps going around. He's like, alright. Let me go check. He goes off to his computer. And as he's checking, I'm like, let me just go look at this bag one more time. It was her bag the whole time. No.
Scott Tolinski
Mhmm.
Wes Bos
The one that drives me crazy is Spotify. If you wanna view our stats on the Spotify podcasters, in some video games. That's why and somebody hits that thing again, especially, like, you open something and you go, oh, I didn't mean to do that, and you quickly hit the the close button Yeah. That should react If you wanna tap, like, three checkboxes, you just wanna go boom boom boom. Like, that's you're really quick at that. And often, if there's a a delay in registering that click two seconds, then then run it, or just give me a button to to actually click search or do it on I don't know. There's a there's a couple different ways to to approach it, but that Adam Wathan of Tailwind tweeted the other day that he couldn't figure out why his select drop downs just felt slower than all the other
Wes Bos
But what's the what's the idea of only doing I get it not on the way in because you want it, but on the way out, it's often because what they're doing is start or down, That's so obnoxious to me, and I much rather be able to just check the three things I want and then and you see And you could just show the first one on there, which I thought was a a kind of a a fun,
Scott Tolinski
even before it kicks off that API call, should be adding that text to the list of data. That way, it pops in
Wes Bos
what, four seconds to show me my my tracking.
Scott Tolinski
useful when done correctly,
Wes Bos
what they're doing is if you keep typing, then they'll just cancel or abort those requests in the background You can very easily extend that process to generate a base 64 blurred version Yes. Or find the dominant color. There's several of these, like, blur up techniques that you can Node.
Scott Tolinski
or does some kind of data call, it hits the API, it hits a server or something. That thing takes who knows how long, could take a little bit of time, a lot of bit of time. Even even, like, four hundred milliseconds, like, you add something to a list and it needs to refresh the list, You're sitting there being like, did it work? Did it work? And so the right answer isn't to put a loading screen here or anything like that. The right answer is to Sanity
Wes Bos
am I offline? Am I Am I offline? Yeah. A new connection? And we have APIs, and we have network connection APIs
Scott Tolinski
says
Wes Bos
you you would go from your submission submission state to your your finish state, and you don't have to show a loader there because it's so quickly. Same with, like, changing pages as well. When you change from one page to another, That's hilarious that you Node exactly what it was. There's probably a million people listening to this right now being like, it's, like,
Scott Tolinski
And,
Wes Bos
Oh, yeah. Yeah. You know what I do? I just I quit the app. I'm just like, I'm I'm sick of this. You know? It's such a flow breaker. I can watch an hour's worth of stories, and I accidentally touch an ad, and it just There's certainly we've talked about how to actually make your website faster. We've talked about that quite a bit, but things. I'm pretty sure I learned this in, like, in business school. So what they did is they not they didn't they didn't make their baggage you just store the data locally. There's no need to to wait around. Right? You get rid of loading states. You get rid of,
Scott Tolinski
where that photo is going to be. I mean, you could even have a blank space with a color, but, like, a blank white space
Wes Bos
I know.
Wes Bos
So
Scott Tolinski
when it's like, here are are five items being loaded in skeleton screens, and then once you actually load the item, it's like one thing pops in. It's like Yes. Come on. You just show me one, I guess, you know, if you're gonna do it at all. Yeah. Right. Possibility of it loading less. Because then I'm like, where'd all that stuff go you're gonna show me? That's yeah. That's a really good point. You think, like, or if there's no results or one result yeah.
Scott Tolinski
You know why? I can't reach it with my thumb. I'm too lazy. I just I quit the entire app through it. And I hope that their stats show that I'm I'm doing that. I Sanity, I think you're probably the exception there because I I agree. I'm the same way. I I hate that stuff. And one thing about animations being cancelable and Vercel, another tip with this too,
Wes Bos
Trust is a big, thing. You know, like, if you wanna, like or you're checking your credit or something like that.
Wes Bos
submit something, like, I spent forever saving drafts, and now I'm submitting it.
Wes Bos
maybe you don't even need to the way they know that it worked is that it literally worked.
Scott Tolinski
had come out, and we all had them. We were standing around, and then the guy comes over to us, and he's like,
Wes Bos
Should it should it take two seconds if you go, like, in a triangle Yeah. Instead yeah. That was that was to click three Bos, you're already doing that
Scott Tolinski
Yes. Right. Totally. Exactly.
Scott Tolinski
yeah, so in Gatsby, you'd use a Gatsby site, you'd click something, and it would just feel like the fastest downloading
Scott Tolinski
to listen for on hover
Wes Bos
And
Wes Bos
I Wes, it gives you context for something JS going away.
Scott Tolinski
that I think is and really understand
Wes Bos
on, like, a key down. That's another one. Instead of waiting for key up, do it on key down.
Wes Bos
nested, to the action immediately. I I also have this on Instagram all the time where you ever accidentally open an ad on, like, an Instagram story? be be very careful with this one, but it is used by lots of websites out there you might not even realize.
Wes Bos
So just It depends, obviously, what your animation is. If you're sliding an entire thing, that's probably
Scott Tolinski
loading experience on the planet. And part of that was preload on hover being part of the experience out of the box. Yeah. That or as fast as it possibly can be. And then, again, on that change,
Wes Bos
with the mouse movements, pipe your yeah. Pnpm your users every mouse move. I try to you have to slow things down to make it look like you're actually doing something.
Wes Bos
you can figure out, oh, somebody's they're headed for the about Tolinski.
Wes Bos
Delay loading indicators mobile website right now.
Wes Bos
show the result before the spinner. What the hell does that even mean? One small change that makes a huge show the result before the spinner. Why? It shows spinner after? Just something about
Scott Tolinski
a trajectory triangle. I don't even know how you would do that. Yeah. You know? Yeah. That doesn't make any sense. Sort of AI
Wes Bos
start loading that page.
Wes Bos
And, like, let's say I'm on, like, the Home Depot website, and I wanna filter for three different categories and and two different colors.
Wes Bos
opens like that in browser web thing, and you can't click x fast enough because the x is in the top left hand corner.
Scott Tolinski
when we came back,
Wes Bos
way to go about it. Because that whole, like, even just text streaming in and, like, updating the UI, that's a very hard problem to solve. I don't know that anyone has has completely nailed it just yet because it is very disorienting when too much is coming in at once.
Scott Tolinski
hit a hit a snag or something. I have no idea. Sometimes this is such a vibe thing to me. Like, I think skeleton loaders can be super
Wes Bos
you you laugh, but, like, that's there's literally libraries out there for that. Well, I use the VisionPRO, if something happens quickly. So pieces of information.
Wes Bos
Start
Wes Bos
if one of them takes a long time, it's often good to either have some sort of delay. Oh, he hasn't interacted with the the filters in
Scott Tolinski
but also oftentimes about later on in this episode.
Scott Tolinski
a blank space,
Wes Bos
The Page says If you think about it, if you wanna do several things very fast, whether it's, let let's say you wanna open up three Bos, and and each of those takes an animation. Right? Three hundred milliseconds to click so that means you're clicking three boxes. It takes you a full second super obnoxious it's so fast that it actually doesn't make sense to show a loading indicator that something is happening because it's just like a split second where you're showing that, like like, a quarter of a spinner. And that is kind of like a weird, like, when you finally
Wes Bos
Yeah.
Scott Tolinski
I know what you're about to say. It is Ready. So awful.
Wes Bos
let's say you're going from your contact page to your about page.
Wes Bos
Or just make your I I think probably both of those are rooted in the websites are actually slow. Actually. Like like, FedEx should not take,
Scott Tolinski
It should have some sort of, like, cancelable, like, oh, this is taking too long. It's clearly, like,
Wes Bos
and then people Scott complaining about it because, like, if you have something to do But in a lot of cases, it's it's well worth it, especially if you have good caching in your web your payloads are not very large. Like, you're going from
Animations should be fast, around 0.2 seconds
Scott Tolinski
the the website should respond ACAV
Scott Tolinski
animations.
Scott Tolinski
Since moved that to point two. Yes. I have since I die I was like, you know what? Whatever it is, dial it back one more. Because a lot of people, they they fall in love with the fact that the thing is animating, and they wanna see that animation. Right? They're like, oh, yeah. That's a great users don't have time for that. And for the most part, you want your animations to be
Scott Tolinski
the thing is broken. Like, I clicked it. What's happening? It's also one of those things that makes the the website
Wes Bos
that's if it's like a button where you wanna navigate somewhere,
Scott Tolinski
the website should respond.
Wes Bos
with all the caveats,
Scott Tolinski
that makes normal users feel like
Scott Tolinski
something happens. Right? And and so that that's a big part of it. Another one here is that animations
Wes Bos
event. For longest time, we use this thing called
Scott Tolinski
not just for because of 60 frames per second, but because almost always Wes you tap something,
Wes Bos
then you might hit it twice because you think it didn't actually do it, and that's very frustrating UX. So, certainly, a skeleton fast click improvements,
Wes Bos
that doesn't necessarily always register an actual action. Right? Totally. There's this weird thing with,
Scott Tolinski
speedy.
Scott Tolinski
Yeah. I I think this all goes back to the idea of Dude. And let me show you. I know this. Let me show I Node this. I know this experience. I've used this, and,
Wes Bos
with iOS. Apparently, iOS still has a forty millisecond seven, eight seconds to to generate.
Scott Tolinski
touch something, when you click it,
Scott Tolinski
And for the longest time, I defaulted to point website. Welcome, Scott. What's up? Hey. I gotta say, if if your website feels faster,
Wes Bos
I'll find myself touching it. And then not not a second. You could do it much faster.
Wes Bos
That can make it feel much faster because you you fire off whatever it is you want right away. It can also be really bad UX as well because often, I find myself Because in in an ideal circumstance, So Wes if you wanted to like, for example, like, checkboxes. Right? important with this AI stuff that can take
Scott Tolinski
instantly or as fast as possible to anything that you're doing in an interaction.
Scott Tolinski
But just that, like,
Scott Tolinski
feel like it's worse than a native app. Many of the things that we're trying to, like, approach with, like, native apps is that they're considered to be faster, smoother, whatever, We were just saying that. Yeah. Pop it in real quick. Oh, you're right. Yeah. The menu bar immediately shows Your FedEx, you have such a good brand opportunity here. We're delivering your information. Hold one second. You know? Yes. Here's a tracking code for your tracking tracking on a back of a thing, a little database does more than just tell you if your application is broken. It also tells you if your application is slow or if it feels slow because respond the moment that you touch something. So too oftentimes, what we're doing is you click a button to perform an action. It goes off and does some kind of fetch he he's like, alright. Here's what we're gonna do. We're gonna make all your things bigger so that way Yeah. Yeah. Well,
Scott Tolinski
when you click something, fast.
Scott Tolinski
And there's several different types of issues that could be at play for why that might feel slow, some of which we'll talk even more or is pixelated just makes me mad, and it makes me feel like the website is slow. Here's something that can feel slow or fast depending on like, I feel like this thing can be really helpful, but at the same time frustrating skeleton screens, which are, like, basically, like, a a skeleton version of your app. Usually missing images, using missing, like, the actual text. Yeah. Using gray boxes that sometimes have, like, a loading indicator.
Transcript
Wes Bos
feel faster.
Wes Bos
Welcome to Syntax. Today, we're talking about how to make your app feel faster than it actually is. So we're talking UI
Use mouse down instead of click for faster response
Scott Tolinski
that's I mean, we're we can measure numbers and whatever that it took this amount of time to load. But, like, isn't it all about how it feels? I think it's all about how it feels. That's that's where I'm at. Yeah. Well, like, if it is faster, it feels faster. But if it's the same speed, but it feels faster
Wes Bos
UI libraries out there, and it turns out they were the only one listening for click. The rest of them were listening for you can fire things off Okay. At least put the text loading. At least put the the very least you could do is put the word loading. And the the worst case is they say, or that that touch touch event, you can make things feel much faster. So, Let's get into it. Let's get into it.
Wes Bos
I got a lot of people angry on Twitter about it. Mhmm. But the the trick here is is that
Scott Tolinski
It's faster. It's faster.
Scott Tolinski
slow
Wes Bos
when they let go. A click is registered when you let go. A a touch is registered when you you let go. So if you listen for the initial
Scott Tolinski
you get all kinds of insights in in terms of being able to see
Scott Tolinski
You know? Because, like,
Scott Tolinski
Sign up using the coupon code tasty treat, all lowercase, all one word, and get two months for free. This podcast is presented by Century.
Scott Tolinski
so long
Scott Tolinski
They're both to meet these Yarn both two two sides of the same coin, and I think they're both valuable techniques to have in your tool belt. You know what else is a valuable tool in your tool belt is Sanity because Sentry
Wes Bos
when somebody is it fades out so you understand that's going somewhere. Yeah. Interesting.
Wes Bos
versus you have to run a process that figures out how big your images are in order to know how big they are. Well, use a aspect ratio. Problem solved. Yeah. I know. But the thing is that, like, you have to process all of your images ahead of time in order to understand And
Scott Tolinski
doesn't that mean it's actually faster? A number of, like, frameworks have this kind of thing built in. So if you're looking to see if your data fetching loading framework has it in, it's gonna be called Optimistic UI. But this is one of those things that could make such a big impact in having your app feel more native. Yeah. And, even one step further than optimistic UI, and I know you'll like this one, is don't have a optimistic UI and just save the data locally and use a a sync engine. Yeah. Yeah. Like, the whole idea behind local first is that what people do with this kind of stuff is they have an opening animation and a closing animation. The opening goes from zero to 100. The closing goes from 100 to zero. So if you cancel it, it's going to jump up to 100 and then go to zero rather than, you know, if you click cancel at 50%, it should stop at 50% and go back to zero. Like, it should not