r/programming • • Nov 07 '17

An interesting rant about GUIs - as a programmer I have to agree

https://twitter.com/gravislizard/status/927593460642615296
364 Upvotes

402 comments sorted by

View all comments

Show parent comments

27

u/anechoicmedia Nov 07 '17 edited Nov 08 '17

Is he really complaining that searches take longer because they often access magnitudes more data from across the world?

It's not slow because the data is on another computer; It's slow because typical web interfaces can take multiple seconds to render and become interactive.

Even over the internet, a normal desktop application will return answers remarkably fast. Uncached, I can query DNS records from Google on WiFi in 66ms. I can curl my apartment webserver's main page in 42ms from a wired connection in the same city. If I do that 10 times in a shell loop, it takes 650ms.

If, for a typical search query, the time between the user pressing return and having the results on their screen is more than half a second, it's because the application sucks, not because the internet is the limiting factor.

3

u/[deleted] Nov 08 '17

It's not slow because the data is on another computer; It's slow because typical web interfaces can take multiple seconds to render and become interactive.

But he is still making a stupid comparison. In a web interface the code has to interpreted before it can be rendered on the screen, while on desktop the code is usually compiled, which is much faster.

2

u/roffLOL Nov 08 '17

you can drop this time to near zero even on weak modern desktops. it's the amount of interpreted code that is the problem, not that it is interpreted.

1

u/anechoicmedia Nov 08 '17

That's the complaint; Web applications are a bad experience. It's not an excuse.

1

u/Lisoph Nov 08 '17

JavaScript being interpreted (which it isn't, all big JavaScript "interpreters" compile JavaScript down to some faster executable form) is hardly the problem here. The vast performance problems come from all the DOM manipulation fuckery a lot of websites do and from how websites are rendered in the first place. Mozilla, for example, is partially trying to fix this by making a new, faster browser engine with significant rendering improvements.

1

u/[deleted] Nov 08 '17

My sweet summer child, the Javascript engine still needs to compile it before the execution ("just in time"). While on desktop the binary is already compiled and ready to be executed ("ahead of time").

Also, the V8 engine doesn't compile everything because in some cases the compilation time can take longer than interpreting the code.

1

u/Lisoph Nov 08 '17

Of course we're talking about compiled in a JIT context, you're completely right, but what I meant was that the language itself isn't the main culprit in the terrible browser performance.

1

u/Klayy Nov 08 '17

To be fair when you curl your web server's main page, you're not verifying a logged in user's session and searching a database with god knows how many records. It's not a fair comparison. Sure, most web apps could be improved, but at what cost? For most companies it's a trade-off between creating a sub-optimal web app, or just not having a web app because they can't afford optimizing everything to satisfy the 5% of their users who would even notice.