Live data from Hacker News

How much your computer can do in a second

computers-are-fast.github.io

161–170 of 244 posts

Re: How much your computer can do in a second

#162
post #148

Earlier quoted context omitted.

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 wa…

Who is funding the developer? Why should they spend $5k (plus the opportunity cost of not using that dev's time on more fruitful pursuits) on 2 weeks of micro-optimization so that their 10,000 users will each experience a speedup so small they'll never even notice (and certainly never pay extra for)? How do you justify that expense?

I'm making a more abstract argument that doesn't have anything to do with money. The time people spend using a piece of software shouldn't be worth less than the time developers spend writing it.

Re: How much your computer can do in a second

#163
post #148

Earlier quoted context omitted.

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 wa…

This equation starts with 0 users and grows pretty slowly at first. It only flips once you have a critical mass of users, and by then it's "too late" to preventatively fix the architecture to bias to performance. There are also lots and lots of products that take a "npm+glue" approach - they ship an initial version that leverages everything possible, and then run aground trying to make it to version 2, because the ar…

This equation starts with 0 users and grows pretty slowly at first. It only flips once you have a critical mass of users, and by then it's "too late" to preventatively fix the architecture to bias to performance.

Sure, but everyone's always planning for the future when they choose databases, backend architecture, etc. Why not plan for the future in user experience, too?

Re: How much your computer can do in a second

#164
post #20

Earlier quoted context omitted.

An eye-opening experience is running an IDE like Visual Studio 6 or a really old version of Photoshop on a modern machine. It starts instantly, compile times are a fraction of what we're used to. The interface is totally responsive. It's remarkable how much better software feels when everything is instant.

It's remarkable how much better software feels when the software was developed on a slow machine. Unfortunately devs invest in the fastest equiplent, so they don't experience how their code runs on the average end user who doesn't upgrade every couple years. In can be useful to test your code in a VM that is deliberately slowed down, so can get a feel for user experience on a slower machine. Then you'll know what par…

Unfortunately devs aren't given any time to optimise it to run on slow machines. It is not a priority.

Re: How much your computer can do in a second

#165
post #20

Earlier quoted context omitted.

An eye-opening experience is running an IDE like Visual Studio 6 or a really old version of Photoshop on a modern machine. It starts instantly, compile times are a fraction of what we're used to. The interface is totally responsive. It's remarkable how much better software feels when everything is instant.

It's remarkable how much better software feels when the software was developed on a slow machine. Unfortunately devs invest in the fastest equiplent, so they don't experience how their code runs on the average end user who doesn't upgrade every couple years. In can be useful to test your code in a VM that is deliberately slowed down, so can get a feel for user experience on a slower machine. Then you'll know what par…

> Unfortunately devs invest in the fastest equiplent, so they don't experience how their code runs on the average end user who doesn't upgrade every couple years.

As someone who doesn't spend much on computer upgrades, I notice this everywhere. Especially when it comes to web development, where everything is optimized for chrome on mac. Don't have a laptop made in the last year? Enjoy a janky-scrolling slow-loading hard-to-read mess.

Re: How much your computer can do in a second

#166
post #154
post #145

Earlier quoted context omitted.

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

the fact that you have to use a scene graph?

What would you use in HTML for a completely custom component? As far as I understand, you'd have to build your own scene graph on top of a canvas.

I mean, if you want standard or semi-standard components, QT has far more out of the box components than HTML does, but the initial complaint was about flexibility for doing something 'very custom'.

Re: How much your computer can do in a second

#167
post #125

Earlier quoted context omitted.

> but you can't actually get /back/ the processed data even if you got all the pixels into a single loop Oh if you need the pixels back, you can certainly get them using glReadPixels(). It's a bit expensive in WebGL land, though it is much less expensive than looping over pixels using JS. And often there are ways to get around needing the pixels back, depending on what you're doing. You can also do loads of non per-p…

Random-order dithering can be done in WebGL, but they are of poor quality. I am talking about error-diffusion dithering, where you are reading and writing pixels, and then re-reading those modified pixels that change the rest of the pixels. In WebGL, you can read the pixels of the image, but you cannot modify and read. You are returning the actual pixel you have modified, which is what glReadPixels() returns. You cou…

Yes, ordered dither is easier in a shader than error diffusion, that's true, but error diffusion is definitely possible on a GPU. If you need it. Do you really need it? Why not still use the GPU to accelerate whatever parts you can? Even if you dither on the CPU, doing your color filters on the GPU instead of in JS could make the difference between interactive and not.

I don't know what you're doing exactly, but when you do need dithering, it's usually the last thing you need to do before output, and it's usually less important that the dither is fast than most other operations you need in an image editor.

BTW, random order is lower quality, and error diffusion is better, only for for very low res color palettes. If your result is more than 256 colors, it's irrelevant, and for high quality dithering, e.g., 16 bits per channel colors to 8 bits per channel for print, random ordered dithering is superior.

https://community.arm.com/graphics/b/blog/posts/when-paralle...

http://www.cs.cmu.edu/~imisra/projects/dithering/HybridDithe...

https://www.shadertoy.com/view/4dt3W7

That last one is ugly, but it's a great proof of concept here. You could get error diffusion in a shader using 2 passes. The first pass you render to texture, and the second pass, you can sample the texture however you want. Note how in this example, the error diffusion propagates backwards from what you would normally do in JS or C++, because it's a shader looping over destination pixels, not code that loops over source pixels.

> In WebGL, you can read the pixels of the image, but you cannot modify and read.

I don't know exactly what you mean here. You can modify & read pixels using render to texture, or using multiple passes.

Render to texture will be faster, if you can do it. Multiple round-trips from CPU to GPU and back will be slower, so you want to limit the number of trips, but it's easy to do.

Re: How much your computer can do in a second

#168
post #148

Earlier quoted context omitted.

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 wa…

Pretty obviously, not all time is equal in the eyes of the company that owns the software. That month of dev time costs on the order of $10k-20k all it where the users time is free from their perspective.

Re: How much your computer can do in a second

#169

Alternatively, this could be titled "do you know how much your computer could do in a second but isn't because of bad design choices, overengineered bloated systems, and dogmatic adherence to the 'premature optimisation' myth?" Computers are fast, but not if all that speed is wasted. A recent related article: https://news.ycombinator.com/item?id=13940014

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…

> E.G: wondering why you see electron apps everywhere now ? 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.

Take portable out and it gets so much easier.

Re: How much your computer can do in a second

#170

Earlier quoted context omitted.

Actually, some software like facial recognition or OCR, does have sleep calls inserted because people don't believe it can be done as fast as it can be done. Thus, whenever I deposit checks at the ATM, I have to stand there and watch as some entirely unnecessary animation pretends to scan my check for ten seconds before I can have my card back.

This strikes me as some kind of terrible vicious cycle: tradeoffs against performance (towards build speed) were made > users got used to slower software > users unconsciously prefer/select for slower software. When you do get to use it, using performant software is a really great experience, so how to we train users to appreciate this?

Sometimes companies do decide to make speed a priority, and earn literally hundreds of billions of dollars off it. One of Google's key features over Yahoo+Altavista was that it loaded instantly; they cut out all the crap from the homepage so you could get yourself to a result in under a second.

Ditto BitTorrent clients like uTorrent and Transmission; the first generation of BitTorrent clients were written in Python or Java, and felt like it. When users started complaining about how they would lock up your machine, somebody actually bothered to write one in highly-optimized native Win32 C, with no frameworks.

You have to understand what the customer is optimizing for though. Someone standing at an ATM is optimizing for confidence, not speed; they already took the time to drive to the ATM, so depositing their check in 1 second vs. 10 seconds doesn't matter when the whole trip takes them 10 minutes. Someone who's responsible for depositing 1000s of checks for a major business, using an office scanner, cares a lot. But I really doubt that industrial-strength check cashing apps put a sleep() statement when scanning the checks.

Post reply on HN