keithamoss / mapa

2 stars 0 forks source link

Loading slowness noticed in Vancouver #1191

Open keithamoss opened 1 month ago

keithamoss commented 1 month ago

We've noticed the initial pre-heart load taking 6-or-so seconds to get to the heart.

I guess it's hitting the Lambda for an API call...but when we refresh I still we still feel it.

Wait, but that happens after the heart is showing, right.

This was when we were out and about on mobile 5G data.

keithamoss commented 1 month ago

Hmm, on reflection it seems other sites are showing a similarish behaviour.

Maybe do some testing on a throttled connection and see what it looks like.

Is there anything else we can do to speed up loading?

Can we print any debugging that shows if cached assets were used or if a network request was done? It sure seems like the cache isn't being fully utilised by how long it was hanging on the heart screen on H's phone.

keithamoss commented 1 month ago

With 1 bar of 5G I spent about 5-7s waiting with the loading bar at 50%, then the heart briefly flashed up and the rest of the site loaded all within 2s like it should.

What's going on in that initial network request? Parsing and executing the JavaScript surely can't be causing it since they're all using Safari under the hood. Network conditions seem far more likely a culprit.

Is 1 or 2 bars of 5G not just slow but ALSO flaky? See what the network conditions API can tell us too.

Hmm, not seeing this in Safari on my copy of the schema. Nor Chrome.

So maybe it's a Firefox issue we can just ignore?

keithamoss commented 1 month ago

Conclusion: Do some more testing on the user's device in different browsers while on mobile data.

keithamoss commented 1 month ago

Seeing the same behaviour on my copy of the map in Firefox (private browsing) as I see for the H's.

So the two issues we're seeing are probably different!

Conclusion remains the same: Test more on the user's device and probably add some more debugging to see what's going on under the hood.

The network timing API is a thing, right?

Ideally maybe we can print a lot of what's happening with timestamps then we'll have some good hard evidence to work with.

keithamoss commented 1 month ago

A similar behaviour appears in Firefox even on decent WiFi. So yeah, ignore that and focus on what was causing the hanging purely on the heart screen for the user.