News for hackers. Stuff that matters.
Re:Performance Matters by Ensorceled on Monday August 19, 2019 @10:54AM (#20738265)
When I was writing software for medical devices in the '90s, we had a very clear policies for dealing with cognitive drift that included performance ceilings, testing for drift in beta testing, etc. In our testing, 10 seconds was the absolute maximum time that a surgeon could "idle" and stay on task in surgery.

In addition, we found that including spinners, progress bars, etc. would not necessarily reduce the cognitive drift but would reduce emotional frustration.

The worst thing for frustration was UI elements being slow; buttons that responded slowly, scrolls that lag, pull-downs that didn't pull down. Exactly as this author notes. There was very little tolerance for those kinds of delays.

I presume that, like website response rate tolerance thresholds that have dropped from 5 seconds to less than 2 seconds now, the medical industry is probably using much lower times now.

Re:Performance Matters by phkahler on Monday August 19, 2019 @11:25AM (#20738558)
>> The worst thing for frustration was UI elements being slow; buttons that responded slowly, scrolls that lag, pull-downs that didn't pull down. Exactly as this author notes. There was very little tolerance for those kinds of delays.

IMHO there is NO excuse for those kinds of delays. None. If you have those issues you're doing something terribly wrong.

Re:Performance Matters by penagwin on Monday August 19, 2019 @11:38AM (#20738697)
I don't know the details, but many embedded interfaces/controllers don't have very fast processors/microcontrollers and UI is really expensive compared to everything else it has to do (take some inputs, and submit some data).

Think about how laggy the raspberry pi 2 or even 3 in the desktop interface. Sure they can be optimized etc, but now imagine what they wouldn've used 10+ years ago and how slow it would be.

EDIT: I have to agree with you guys, even given the tech they had they should've put a higher priority on responsiveness. I don't know what the status is today, but I know even the 2015 Prius's touch screen feels too unresponsive to my liking.

Re:Performance Matters by dahart on Monday August 19, 2019 @12:03PM (#20738931)
Respectfully, that is a common and tempting argument, but no, no, and no. The raspberry pi 3 has a freaking dual core 64-bit 1.4Ghz processor that is more than fast enough to run full-screen video games at 60Hz.

It's more than just an "optimization" that is making UIs on these plenty-fast processors so slow, it's a large scale failure of software engineering, building slow layers on top of slow layers.

The processor is not the reason for slowness, and we've had absolutely responsive UIs not just 10 years ago, but 50 years ago too. The actual reason is economic: cheap engineering. Using freely available components not well suited to embedded devices, writing layers using scripting languages because it's easy, treating the problem as solved when the functionality is there without regard to the speed.

Re:Performance Matters by Faark on Monday August 19, 2019 @12:30PM (#20739204)
On the other hand, the times were the CPU was polling keyboard resistances and then directly controlling your CRT's electron beam accordingly are long over. Today's systems are complicated, and we try to hide that complexity behind abstractions. All of those with buffers. Input buffers, OS message buffers, tripple image buffers, and so on. All of it adding time.

Yes, we won't again have the responsiveness we had 30 years ago. Because the tradeoffs are just not worth it. At the same time, stories like the article are a necessary reminder of there being worth in performance.

Re:Performance Matters by dahart on Monday August 19, 2019 @12:42PM (#20739315)
There's unnecessary complexity and abstractions -- especially in poorly designed systems, yes, that's part of my point, so I agree there.

> we won't again have the responsiveness we had 30 years ago.

Not sure I can agree with that. For the best systems, we absolutely have better responsiveness now than we've ever had, shorter latencies now in the hundreds sometimes thousands of hertz, and orders of magnitude more compute we can put in between input and response.

Maybe the worst systems are getting worse, but I think on the whole responsiveness has been monotonically improving since the invention of the microchip.

> the times were the CPU was polling keyboard resistances and then directly controlling your CRT's electron beam accordingly are long over.

I don't know every system ever made, but I don't think there was any long period of time when application software on digital computers controlled the electron beam in a CRT directly or polled keyboard resistances directly, those were abstracted by the hardware via DACs & buffers more or less from the start. Maybe some of the old vector display video games did, I'm not certain, but in any case, it's been abstracted that way for more than 30 years. The first framebuffers happened almost 70 years ago, before 1950.

Re:Performance Matters by mntmoss on Monday August 19, 2019 @03:43PM (#20741090)
The raw throughputs are definitely better but there is concern regarding latency even at the lowest levels, since today's CPUs have complex cache, power state and frequency throttling mechanisms. You cannot guarantee that something will perform with identical runtime in all expected use-cases unless you take care to use hardware that is optimized in that direction. And because the software environments are more complex a lot of capability is just dropped on the floor because the intermediate layers get in the way.

W/R to buffers in front of things, a decent number of the micro systems of the 70's were so memory starved that they would make these tradeoffs to retain video sync - that describes the Atari 2600("racing the beam" is the name of a book about the console), and Cinematronics vector games(if it did not complete drawing at 60hz, it reset). Most early arcade games did work with DACs(or rather ADCs) but ran their own calibration and button debounce code - and even with layers of abstraction that's still basically true today.

With graphics, the move towards desktop environments doing GPU compositing impacts graphics coders, since they now often have window manager buffers in front of them instead of direct access to a rectangle of pixels.

Web browsers are a more extreme example of this. Because the graphics model revolves around document presentation, things that aren't really documents, or are extremely customized documents, often get burdened by latency that they wouldn't have if it weren't for the browser.

Re:Performance Matters by dahart on Monday August 19, 2019 @04:49PM (#20741686)
Ah, I've been meaning to read Racing the Beam for years!

That's all true, and thanks for an insightful comment!

I would just add though that it's easy to frame things in a way that makes it seem harder than it really is to maintain responsiveness. For example, while yes caching makes guaranteeing exactly repeatable timing a problem, that's an issue at the nanosecond/microsecond level, and not really a problem at the millisecond (human perception) level at all. Today's hardware doesn't have issues maintaining 60hz unless the software isn't even trying.

Another counter-example would be that while yes, browsers and desktop UIs are doing compositing and don't have direct access to the pixel buffer, the compositing is actually done on the GPU via low-latency commands. Direct access to the pixel buffer would actually be much slower than what we have right now. The browser has no trouble responding and rendering at 60hz unless you do things that cause more than the ~16ms of compute you have time for. Triggering page reflows will do that, but compositing an animated WebGL canvas over something else on the page is plenty fast.

Re:Performance Matters by bbojan on Monday August 19, 2019 @04:45PM (#20741647)
Check out https://danluu.com/input-lag/ , where the author measured latency between a keypress and the display of a character in a terminal for systems built 1977-2017.

For example, Lenovo Carbon X1 4th gen running Windows has about 5x the latency of an Apple 2e.

Re:Performance Matters by dahart on Monday August 19, 2019 @04:58PM (#20741769)
This is a great chart, and I've seen it before here on HN.

Just in case you were thinking this is perhaps a counter-example to what I said, I think it's the other way around, it very much supports my claim. The processors have (obviously) gotten faster, and yet for some applications latency has seemingly gone down. Why? Software and requirements are the reason, not hardware.

Terminals also are not an example of the "best systems" in terms of latency. You'd be much closer if you looked at video game latency, or tracked industrial applications that have low latency requirements from the start. The whole reason terminals have gotten slow is that they aren't trying to go fast.

Quite a few of today's most modern terminals have recently added performance as a feature, started rendering with the GPU, and quite predictably, they are restoring super fast response times to our terminals. iTerm2 would be an example of this.

Re:Performance Matters by novok on Monday August 19, 2019 @01:43PM (#20739902)
You can make apps with complicated, animated UIs that respond in 16ms just fine with the hardware of an iPhone 4, which is way past the era of CRTs and direct keyboard polling. We know this because we made those apps 7 years ago.

Performance is always a business decision. Most people don't want to pay for it.

Re:Performance Matters by Faark on Monday August 19, 2019 @04:30PM (#20741507)
I admit not having good, hard data. My most vivid related memory is comparing the back then new flat screen to the my CRTs and being disappointed with both delay and sharpness (CRTs exponential decay is way nicer imo). Obviously wouldn't expect those to have gotten worse, though.

Anyway, you mentioned phones: 16ms from touch to response on screen? That's hard for me to believe and I'd love to read up on that, if you got any sources. The ones I've found were not that great but don't paint such a good picture. [0] is an article claiming touch sensors scan only once per frame, aka 16ms at the time. [1] claims ~85ms to response on an iPhone 4, ~55ms on iPhone 5. How were you able to easily beat those by such a margin?

[0] https://www.anandtech.com/show/9605/the-ios-9-review/9#Input...

[1] https://www.cnet.com/news/iphone-5-touchscreen-2x-faster-tha...

Re:Performance Matters by novok on Tuesday August 20, 2019 @12:54AM (#20743945)
There are other parts of the program beyond touches, such as scroll performance and what you do in reaction to touch events. Also the user doesn't move their finger within 85ms anyway if you think about it. That is moving to tap the phone, smushing their finger into the phone and then moving their finger away from the phone to see the result.

Nowadays you have 120hz scrolling on the ipad and the very fast responsiveness of things like the apple pencil, which shows you that responsive hardware and software is definitely possible.

Re:Performance Matters by varjag on Monday August 19, 2019 @02:34PM (#20740414)
I have a distributed networked system on $35 off-the-shelf modules running Linux synced to under 100 microseconds measured deviation.

There is no good technical reason for slow UI elements in 2019.

Re:Performance Matters by tcxgy on Monday August 19, 2019 @01:49PM (#20739980)
> Respectfully, that is a common and tempting argument, but no, no, and no. The raspberry pi 3 has a freaking dual core 64-bit 1.4Ghz processor that is more than fast enough to run full-screen video games at 60Hz.

Windows XP on a Pentium 4 was snappier than Windows 10 is on an i7 today.

Re:Performance Matters by jblow on Monday August 19, 2019 @11:50AM (#20738818)
The Amiga 500 was pretty responsive, and its CPU power was epsilon compared to a Raspberry Pi or any modern embedded system.

It's just that modern software is garbage. That's all.

Re:Performance Matters by arendtio on Monday August 19, 2019 @12:12PM (#20739025)
I agree. A few years ago, I powered up some old 166 MHz Windows 95 PC and was surprised how fast it was (certainly not on all tasks, but in general).
Re:Performance Matters by renox on Monday August 19, 2019 @01:04PM (#20739520)
And Amiga had no memory protection which means that it would be very unsafe to use Internet with it. That said BeOS was quite responsive and had memory protection, but still inadequate security for modern security attacks.
Re:Performance Matters by bmurphy1976 on Monday August 19, 2019 @03:07PM (#20740760)
The memory protection doesn't account for the performance hit. It's all the layers of shitty software and garbage devices on top.
Re:Performance Matters by renox on Tuesday August 20, 2019 @05:27AM (#20745071)
Memory protection only adds a small performance hit that's true but it also requires a totally different way of working. I don't know much about Amiga but I remember that when reading about Synthesis (a very fast & low latency kernel https://en.wikipedia.org/wiki/Self-modifying_code#Synthesis ) thinking that it was only possible without memory protection..
Re:Performance Matters by Diederich on Monday August 19, 2019 @05:11PM (#20741869)
In 1995-1997, I wrote and maintained an application that was used, during every surgery, in critical ways in every operating room in a large, regional hospital.

This app ran on a regular computer running normal Microsoft Windows 95. It wasn't terribly complicated, but it also wasn't simple. It accessed a database over the wired network for most everything it cared about doing.

It took some thought and care, but it wasn't impossibly difficult to ensure that the app was always highly responsive.

I think it comes down to priorities. I worked closely with the doctors who were actually using this app on a day to day basis, and working with an app that didn't slow them down was quite important for them.

Re:Performance Matters by yoz-y on Monday August 19, 2019 @12:05PM (#20738954)
Many systems have historically prioritized how nice they look at the expense of speed. First Mac OS X releases were notoriously sluggish for example.

I cringe every time I see a laggy but 'nice' looking interface. I'd rather see a wireframe with just text, it will still be more useful than a button I can never trust.

Re:Performance Matters by ben509 on Monday August 19, 2019 @12:10PM (#20739001)
Given the clueless remarks I see that are invariably followed by, "I work on embedded systems," I suspect there's more bad engineering to blame than deficient hardware.
Re:Performance Matters by ambicapter on Monday August 19, 2019 @11:52AM (#20738831)
Don't think it really matters, if your device can display a dropdown, then it can display an empty dropdown and load entries within a couple seconds.
Re:Performance Matters by arendtio on Monday August 19, 2019 @12:08PM (#20738987)
I use a Progressive Web App on a Samsung Galaxy S3 smartphone (1GB RAM) on a regular basis. If the phone just got a fresh ROM, rebooted within the last hour and the app is a fresh installation, I have no performance issues what-so-ever (~60 FPS animations, etc.).

But over time things degrade. I don't know why, but every year or so I have to format the internal SD card to keep the OS in shape. If I install too many apps which run in the background the RAM gets crowded and everything starts lagging.

And finally, the app itself is not as optimized as it should be, so that when I use it with the data I enter during a year or so, there are some steps which take a few seconds (rendering a list with >300 items/DOM nodes). By the way, a 'couple of seconds' is unacceptable from a UX perspective.

So this is just one example where you can have a 100% good experience but also a very degraded experience with the same hardware and software, due to different factors (from OS degradation to awful O(n) optimization).

Re:Performance Matters by wmf on Monday August 19, 2019 @05:52PM (#20742168)
many embedded interfaces/controllers don't have very fast processors/microcontrollers

I'm reminded of the discussion the other day about military procurement ignoring software. Prototype the UI first, then choose a processor that's fast enough.

Re:Performance Matters by Ensorceled on Monday August 19, 2019 @11:43AM (#20738754)
Well, we used to have to write our own UI elements and swap them into the top 8 bits of the framebuffer reserved for the overlay.
Re:Performance Matters by wpietri on Monday August 19, 2019 @10:22PM (#20743350)
I don't know how optimistic I'd be about the whole industry. I'd suspect medical devices are way more disciplined than EHR apps.

A friend's sister is a doctor. We happened to be visiting her hospital the week they were rolling out a new system. If if I recall rightly, her hospital was part of a multi-hospital company, and they were developing it in house. The developers were in some location distant to the hospital, and my doctor pal had never met anybody who worked on it.

From my perspective, the thing was a disaster. Not only was it laggy as hell, but the interface was dumbfoundingly bad. For a doctor to prescribe something for a patient, the would have to pick the medication name from an absurdly long drop-down. Then they could type in a quantity and pick a unit from a pulldown that had mcg, mg, g, and kg choices. Once that was entered, it would show up on the reports nurses would use to give medication. However, they didn't have the field sizing right on the reports, so 100 mg would turn into 10 mg. It was only nurse experience that kept people from getting dangerously wrong doses of their medication.

The whole thing was hot garbage of exactly the sort made in a big waterfall process by developers who never met the users and never saw them in action. I'm sure every bit of it was technically to spec, but I'd be amazed if nobody died from it.

Re:Performance Matters by Ensorceled on Tuesday August 20, 2019 @06:23AM (#20745314)
It's the procurment process and the lack of skilled management. With the Ontario eHealth debacle[1], the people in charge were hospital administrators with no software project experience. They were taken advantage of by the contractors, their employees and, to be fair, their own greed. These kinds of large projects really need to spend the money on a real CTO and/or CPO.

[1] https://en.wikipedia.org/wiki/EHealth_Ontario#Consulting_and...

Re:Performance Matters by mcntall on Monday August 19, 2019 @11:28AM (#20738593)
This is one of the reasons why you will often see software installation look linear [10min until it is finalized, 8min until is finalized...] even though on a micro-scale, the process may be oscillating a lot more.
Re:Performance Matters by penagwin on Monday August 19, 2019 @11:42AM (#20738734)
I highly doubt most programs know when they'll finish, usually there's multiple stages of say installation, copying files, editing the registry, generating some other files, downloading updates, etc. Some of those stages take milliseconds, others can take minutes or longer. Maybe some take seconds on an NVME SSD but takes 4 minutes on an HDD (verifying files commonly has this behaviour), etc.

If the progress bar doesn't differentiate which stage it's in then it's purpose is mostly just to let the user know it's doing something.

Re:Performance Matters by mark-r on Monday August 19, 2019 @12:09PM (#20738997)
I had an Epson scanner that had a progress bar while scanning. You could HEAR the scanner progress, and it wasn't close to even - sometimes it would stop for a while, or even back up. It didn't matter though, the progress bar kept an even pace and always finished at the exact instant the scan was done.

That has always stood out as one of the more impressive engineering feats I've seen.