5 ms·
I would read the <500ms screen loads as follows: When the user clicks a button, we start a server round-trip and fetch the data and do client-side parsing, lay
by fxtentacle 2y ago
I would read the <500ms screen loads as follows:
When the user clicks a button, we start a server round-trip and fetch the data and do client-side parsing, layout, formatting and rendering and then less than 500ms later, the user can see the result on his/her screen.
With a worst-case ping of 200ms for a round-trip, that leaves about 200ms for DB queries and then 100ms for the GUI rendering, which is roughly what you'd expect.
- fidotron 2y agoIf you are good those numbers are an order of magnitude off. In truth it is probably mostly auth or something. If you simply avoid json you can radically attack these things fast. RTT to nearest major metro DC should be up to 20ms (where I am it is less than half that), your DB calls should not be anything like 200ms (and in the event they are you need to show something else first), and 10-20ms is what you should assume for rendering budget of something very big. 60hz means 16ms per frame after all.
- x0x0 2y ago> RTT to nearest major metro DC should be up to 20ms (where I am it is less than half that) over a mobile network? My best rtt to azure or aws over tmobile or verizon is 113ms vs 13ms over my fiber conection.
- deleted 2y ago[deleted]
- fidotron 2y agoWith times like that you'd be better off with Starlink! I'm not joking: https://www.pcmag.com/news/is-starlink-good-for-gaming-we-put-spacexs-satellite-service-to-the-test https://www.pcmag.com/news/is-starlink-good-for-gaming-we-pu... Are you doing the 113 test from the actual device, or something tethered to it? For example, you don't want a bluetooth stack in the middle.
- x0x0 2y agostraight off my android phone by disabling wifi then moving through my 2 sims
- pinoy420 2y agoDon’t take the bait. It is a typical hn hyperbole comment
- throw5959 2y agoIf you have a dual SIM phone, try to swap your SIMs.
- fidotron 2y agoThat is odd then, but it is odd. I can only guess the connectivity between your mast and the Internet is awfully congested, and/or you are in the middle of nowhere. One of the reasons starlink does as well as it does is the ground stations are well connected to the wider world, whereas your nearest cell mast might not be.
- harrall 2y agoNah it could also be differing peering agreements with the ISP and the data center you are connecting to. On T-Mobile, I get 30ms to Cloudflare but 150ms to my local AWS. But I also get 450 mbps on T-Mobile so I’m not complaining.
- gf000 2y agoWhat percentile? Topics like these don't talk about the 5G connected iphone 16 pro max, but have to include low-end phones with old OS versions and bad connectivity (e.g. try the same network connectivity in the London metro, where often there is no receiption whatsoever). As you reach for higher percentiles, RTT and such start growing very fast. Edit: other commenter mentioned 75% as percentile.
- fingerlocks 2y agoIndependent of connectivity, UI rendering should be well under the device refresh rate. Consider the overhead of a modern video game that runs 60fps without a hiccup. It’s ludicrous that a CRUD app which usually only populates some text fields and maybe a small image or two can’t do the same
- gf000 2y agoThat's a page load, not a frame render. Also, due to layouting, a CRUD app may actually be harder to optimize per frame, than the trivial to parallelize many triangle case as seen in games.
- fingerlocks 2y agoOP gave a render budget of 100ms _after_ the data has loaded. That’s unacceptable. If this were a MacOS app, that would mean dragging a window corner to resize the content , forcing a new layout and redraw, would yield 10 fps of change. And yet nearly all native apps redraw and layout instantly, even with complex tables of text at various fonts and sizes. This is also a great litmus test to check if an app was made with electron because they always redraw slowly.
- fidotron 2y ago> What percentile? There's no argument that starts this way which doesn't end either with "support working offline", or defining when you consider that a user has stepped out of bounds with respect to acceptable parameters, which then raises the question what do you do in that event? If all you're trying to do is say 75% of users have a good experience, and in your territory 75% means a 150ms and that's too long then the network cannot be in your critical path, and you have to deal with it. If you're on a low end phone any I/O at all is going to kill you, including loading too much code, and needs to be out of the way. If you can tell the UX is going to be bad you will need to abort and tell them that, though they really will not like it, it's often better to prevent such users ever getting your app in the first place. I come from mobile games, and supported titles with tens of millions of players around the world back in the early 4G era. All I can tell you is not once did mobile ping become a concern - in fact those networks are shockingly good compared to wifi.
- cellularmitosis 2y ago100ms to render an iOS screen means dropping 6 frames. That would put an applicant in the "no hire" category.
- joaohaas 2y agoSince the post is about the benefits of react, I'm sure if requests were involved they would mention it. Also, even if it was involved, 200ms for round-trip and DB queries is complete bonkers. Most round-trips don't take more than 100ms, and if you're taking 200ms for a DB query on an app with millions of users, you're screwed. Most queries should take max 20-30ms, with some outliers in places where optimization is hard taking up to 80ms.
- andy_ppp 2y agoI do not understand this thinking at all, a parsed response into whatever rendering engine, even if extremely fast is going to be a large percentage of this 500ms page load. Diminishing it with magical thinking about pure database queries under load with no understanding of the complexity of Shopify is quite frankly ridiculous, next up you’ll be telling everyone to roll there own file sharing with rsync or something…
- flohofwoe 2y agoI know - old man yells at cloud and stuff - but some 8-bit home computers from the 80s completed their entire boot sequence in about half a second. What does a 'UI rendering engine' need to do that takes half a second on a device that's tens of thousands of times faster? Everything on modern computers should be 'instant' (some of that time may include internet latency of course, but I assume that the Shopify devs don't live on the moon).
- chrisandchris 2y agoMoorsches Law v2 (/s) states that while computers get faster, we add more layers so computers actually get slower.
- ezekiel68 2y agoBack when "WinTel" was a true duopoly, we used to call this "Gates Law".
- bluGill 2y agoPeople have gotten used to that, but UI work back to the 1960s has done studies and showed clearly that for many of these operations you get tens of ms before people notice and their attention wanes. The web often doesn't allow for response times as fast as the humans need, which is a good reason to write real apps not web apps. That is also why I use tabs - load a bunch in the background so when I'm ready I can just switch tabs and it is there.
- sgarland 2y ago> 200ms for DB queries No. Just no. There’s an entire generation of devs at this point who are convinced that a DB is something you throw JSON into, use UUIDs for everything, add indices when things are slower than you expected, and then upsize the DB when that doesn’t fix it. RAM access on modern hardware has a latency of something like 10 nanoseconds. NVMe reads vary based on queue depth and block size, but sub-msec is easily attainable. Even if your disks are actually a SAN, you should still see 1-2 msec. The rest is up to the DB. All that to say, a small point query on a well-designed schema should easily execute in sub-msec times if the pages are in the DB’s buffer pool. Even one with a small number of joins shouldn’t take more than 1-2 msec. If this is not the case for you, your schema, query, or DB parameters are sub-optimal, or you’re doing some kind of large aggregation query. I took a query from 70 to 40 msec today just by rewriting it. Zero additional indexing or tuning, just unrolling several unnecessary nested subqueries, and adding a more selective predicate. I have no doubt that it could get into the single digits if better indexing was applied. I beg of devs, please take the time to learn SQL, to read EXPLAIN plans, and to measure performance. Don’t accept 200 msec queries as “good enough” because you’re meeting your SLOs. They can be so much faster.
- reissbaker 2y agoI think 500ms P75 is good for an app that hits network in a hot path (mobile networks are no joke), but I agree that 200ms is very very bad for hitting the DB on the backend. I've managed apps with tables in the many, many billions of rows in MySQL and would typically expect single digit millisecond responses. If you use EXPLAIN you can quickly learn to index appropriately and adjust queries when necessary.
- gooosle 2y ago500ms p75 is not good for the (low) complexity of the shopify app. Also reporting p75 latency instead of p99+ just screams to me that their p99 is embarrassing and they chose p75 to make it seem reasonable.
- charleslmunger 2y ago>RAM access on modern hardware has a latency of something like 10 nanoseconds What modern hardware are you using that this is true? That's faster than L3 cache on many processors.
- gooosle 2y agoThe 500ms number is p75 - not worst case at all. 200ms round trip is like 10x more than what's reasonably possible. Same with your other numbers.
- np_tedious 2y agoWhat does "DB queries" mean here? The on-device sqlite stuff?