Live data from Hacker News

How much your computer can do in a second

computers-are-fast.github.io

141–150 of 244 posts

Re: How much your computer can do in a second

#141

Earlier quoted context omitted.

It's wasted only if it's not traded for something else. But it is. A lot of system would simply not exist if we would have waited for people doing it properly because there is a limited pool of very skilled experts and the demand for IT far exceed our ability to supply. Plus writing good code takes a lot of time and resources, but our society changes now so fast that it very well maybe rewritten next year. Hence, we…

> until now making a beautiful, powerful and modern app with a portable GUI was something only a few people would be able to do. Now any web dev can do it Anybody could do it before, including web developers, using, say, Qt with C++ or Python. Or are you suggesting that web developers are not capable of learning?

No I'm suggesting the ratio result/effort between a QT app and a electron app is strongly in favor for electron for web dev.

Actually I'm not suggesting. I'm witnessing.

Re: How much your computer can do in a second

#142
post #130

Earlier quoted context omitted.

Electron targets front end dev and people with knowledge of JS + HTML + CSS.

So, your claim is that using electron has got nothing to do with it being easier or simpler. It's just running off inertia?

HTLM + CSS is right now the easiest combo to create a really custom UI. Try to do something very custo with QT or Wx that is portable and you'll notice it's way, way more work. Combine that with the face web dev already know HTML + CSS and the related tooling, and you got the answer.

Electron apps are slow, eats a lot of resources, weight a lot of Mo and don't have a native UI integrated with the OS. You really need a SUPER good reason to use it. And the reason is it's familiar, easier and more productive.

Re: How much your computer can do in a second

#143
post #80

What an excellent teaching pattern - you're far more likely to remember what you learned if you first stop to think and record your own guess, and this is excellent UI and UX for doing that routinely and inline.

This page from the New York Times is another great example of teaching through interaction: https://www.nytimes.com/interactive/2017/01/15/us/politics/y...

Re: How much your computer can do in a second

#144

Earlier quoted context omitted.

Compilers can only optimize away loops if they know that the loop has no side effects. Compilers like GCC have to have a list of standard functions that they know are pure. This can trip you up sometimes. For example, if you do something like use memset to zero out sensitive data when you're done using it, the computer can say "the result of memset is never used, and the reference to that memory is lost, so there's n…

Forgive me if I don't know what I'm talking about here, but could volatile be used here to force the compiler to perform the memset?

You're correct. (https://barrgroup.com/Embedded-Systems/How-To/C-Volatile-Key...)

But again, you're telling the compiler that you know what you're doing, and to not perform its normal optimization. I'm not well-versed in compiler design, but I think that's the tradeoff you have to make between trusting the user's design choices, or not.

Re: How much your computer can do in a second

#145
post #130

Earlier quoted context omitted.

So, your claim is that using electron has got nothing to do with it being easier or simpler. It's just running off inertia?

HTLM + CSS is right now the easiest combo to create a really custom UI. Try to do something very custo with QT or Wx that is portable and you'll notice it's way, way more work. Combine that with the face web dev already know HTML + CSS and the related tooling, and you got the answer. Electron apps are slow, eats a lot of resources, weight a lot of Mo and don't have a native UI integrated with the OS. You really need…

Is it? Looks pretty easy to me: http://doc.qt.io/qt-5/qtquick-canvas-example.html

You get a full scene graph to play with. What exactly do you think is missing? http://doc.qt.io/qt-5/qtquick-visualcanvas-scenegraph.html

Re: How much your computer can do in a second

#146
This is awesome. The real lesson here is, when you make a thing, compare its performance to these kinds of expected numbers and if you're not within the same order of magnitude speedwise, you've probably screwed up somewhere.

My favorite writeups are the ones that gloat about achieving hundreds of pages served per second per server. That's terrible, and nobody today even understands that.

Re: How much your computer can do in a second

#147

Earlier quoted context omitted.

WebAssembly and languages compiled to JS make it immaterial.

I'm not sure how. WebAssembly is more limited than JavaScript (e.g. no access to DOM), and also more limited than native code (e.g. much more limited threading story).

I thought they were working on adding DOM stuff too?

Re: How much your computer can do in a second

#148

Earlier quoted context omitted.

> Because until now making a beautiful, powerful and modern app with a portable GUI was something only a few people would be able to do. Except it's none of these things: electron apps suffer the same presentation-before-content problems as most of the web, they inherit all of the state bugs of web apps, and they're painfully slow despite usually just being menus of nested lists and text boxes. It's passing a burden…

Let's be clear, I dislike slow apps, I think current behemoth web pages size is a monstrosity and every time I start an electron app (minus the excellent vscode), I scream in my head. Yet. Most electron app I tried have a ratio result/effort far better than any other solutions for the dev.

Why do we care so much about the dev? There are way more people who use a typical program than there are people who develop it, and these people often use the program more frequently than the developers make changes to it.

For example, if a feature is used every day for a year by 10,000 people, speeding it up by 200ms is worth over a month of developer time (200ms for 10,000 people over a year is 203 hours of time wasted, which is about 25 8-hour days, or five 40-hour weeks).

Re: How much your computer can do in a second

#149

If, like me, you spend most of your time in high-level, garbage collected "scripting" languages, it's really worth spending a little time writing a few simple C applications from scratch. It is astonishing how fast a computer is without the overhead most modern languages bring in. That overhead adds tons of value, certainly. I still use higher level languages most of the time. But it's useful to have a sense of how f…

>It is astonishing how fast a computer is without the overhead most modern languages bring in.

No kidding! I once implemented Knuth's Dancing Links/Algorithm X[1] in Python, as part of a Sudoku solver. At one step in the algorithm you need to choose from a group of "things to do next"; the C version I was using as a reference just chose "the next item" in the group (it was stored as a linked list). Changing it to the more efficient method of scanning all the items and choosing the one which would more fully constrain the search space made no obvious difference in the time it took to solve a 9x9 Sudoku -- practically instant.

In the Python version, the efficient strategy also solved 9x9's practically instantly; the simpler strategy ended up taking several minutes! I forget exactly how many unnecessary steps the simpler version ending up taking -- hundreds of thousands, maybe -- but the C code just got out of the way and let the processor crunch through them too quickly to care about.

[1] https://www.ocf.berkeley.edu/~jchu/publicportal/sudoku/00110...

Re: How much your computer can do in a second

#150
post #118

Earlier quoted context omitted.

Yes, the same applies to save buttons. If saving takes less than 200ms people are not confident the save really happened. There are also UI animations that deliberately slow things down to prevent the user from getting disoriented. This doesn't prove that product managers want software to be slow though.

Agreed. I think PMs have their own motivations, but ruining things for others is not explicitly part of their grand plan.

I don't think it's fair of you to switch to the language "ruining things for others" - of course they don't want to explicitly "ruin things".

If you had said, "I don't think making sure that things don't happen instantly is explicitly part of their grand plan" then I would dispute that statement. (Yes, making sure things don't happen instantly is explicitly/implicitly part of their grand plan.)

They want users to have an "experience" not just click a button or press a key and instantly see the result. It is very explicitly part of their plan, and if the algorithms don't slow things down enough, they actually request animations or loading screens that do so.

Some of it may be implicit, rather than explicit. For example, a front-end javascript framework might actually produce pixel for pixel the exact same result as a simple HTML file generated more quickly on the back-end might do, but could still be a preferable "experience".

All this could be tested explicitly. For example two groups of PM's could evaluate web sites, where one included Working... screens where a javascript framework slowly renders something client-side, and the other could have pixel-for-pixel the same thing served from the server, using less bandwidth than it took to even transfer the javascript files over, so that the result is served much, much faster.

I hereby formally predict that some PM's will prefer the slower version for the exact and only reason that it is a slower user experience, and that this could be verified with a double-blind and carefully controlled experiment. I've put my claim out there, and it is easily falsifiable as well as has explanatory power in terms of the software we actually see.

Very simply: some PM's prefer a slower user experience. (I claim.)

Post reply on HN