-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow page changing #377
Comments
Here is the video of solid looking laggy even for the most basic view |
A reproduction would really help here, even if it does happen with 'any solid app with this router and links', I for example haven't experienced it in my apps. Could it be something to do with transitions causing page navigation to be delayed while waiting for stuff to load? |
I'm not sure about transitions but it's slow. For reproduction do "npm create solid@latest" and select basic template, add any routes and use |
Yeah hmm.. I'm not seeing it. Even with 6x CPU slowdown on desktop. It is possible there is some sort of performance thing. Maybe even platform specific. Do you see this same lag on: https://docs.solidjs.com/? This is a real site so there are other considerations there but I just want to sort of figure out where to narrow this down a bit because as Brendonovich says there are 1000s of sites out there using the router and this hasn't been reported before. |
I experience it on iOS RPReplay_Final1708106344.mp4RPReplay_Final1708106237.mp4 |
Look how slow it is on Solid compared to Svelte |
Isn't this more related to network being slow and the routes being loaded lazily? I noticed that the payload from the loaded route data in the svelte docs is like @DoctorRyner did you have a look at the network tab (for size comparison) and while trying to throttle the network speed? |
The page size doesn’t matter, it’s slow even in bare app with no js/css I use SvelteKit rn and I don’t have this issue in my app. Look at the video I posted above, this is how it works on an iPhone even on bare app. For some reason the route changing is slow on iPhone |
Hello @oddcelot @ryansolid , |
It isn't fetching from network after loading them first time. It is slow even on a macbook m1 / asahi, compared to svelte docs. But I think it's related to |
@mattbdc nah, I first experienced it in my bare bone project, so it must be related to router |
We've been experiencing this in a Tauri + Solid project on iOS, it seems to happen with |
The problem is that safari iOS adds a 200ms delay to anchor links if you have a mouseover event installed. I tried finding an official source for this, but all I could find was a random reddit comment. The following hack removes the delay for me.
When I looked into this, I was surprised to see that solid-router hooks into a bunch of global events for this instead of attaching them to the Possible fixes:
|
There is another source of a click delays that need separate fixing, though those are not caused by solid-router
or alternatively, you need |
Interesting, just anecdotal/unbenchmarked it definitely felt like more than 200ms to me, it felt closer to 1s, I'm not sure I would notice 200ms, I wonder what svelte is doing as that didn't suffer.. |
I think the delay mentioned in my second comment is more than 300ms. Perhaps they are even additive.... |
I face the same problem with slow page changing when using either A minimal reproduction code can be found here: https://github.com/JensForstmann/slow-solidjs-router I also included a video/screen recording. |
Disabling route prefetching seems to fix this on IOS. I personally disabled the default prefetching on hover behaviour and used an Intersection observer which tracks links appearing on the viewport and preloads the routes manually through the Combined with a good CDN caching setup on preloaded queries, and this makes your app feel super fast and snappy on navigation. |
Thanks for the tip. I've disabled it for my simple app and it makes it remarkably better to use on iOS. |
Can someone share a code sample, I don’t see any option for disabling prefetch. I experience this delay on the docs as well. |
|
This is really unfortunate that iOS is delaying stuff when you have mouse events. Most frameworks these days have some sort of link prefetching by default. It is odd to me that something like Svelte docs wouldn't employ that technique. I wonder if we are supposed to use platform detection to decide and just disable on iOS or something. In fact I definitely see the Svelte website doing preloading in the docs on hover. So does it do the preloading on iOS I wonder.. does it do it with different events? Forcing the end developer to disable all preloading for all platforms feels terrible and I doubt anyone does that. I feel like we are missing a critical piece of information. @jpdutoit your suggestions seem the most helpful but I have no way of confirming them.
|
it might be just me, but i get at least perceived reduction in delay using a bit of CSS tested with repro from #377 (comment) a {
touch-action: none;
} |
hmm, i was logging all the events on the element and |
Describe the bug
Changing pages takes way too much time on iOS and even on desktop if the app is a bit demanding like when it has a background animation. It doesn't matter is it's SSR or standard SPA. I checked with svelte-kit and it is always instant there
Your Example Website or App
any solid app with this router and links
Steps to Reproduce the Bug or Issue
Expected behavior
Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: