> So correct UI applications cannot call any blocking function from their main threads. Author is redefining "correct" to mean "has the property I care about, which in this case is performance". There are many desirable distinct properties of a computer system: correctness, performance, security, etc. "Correct" usually means something like "gives the right answer". It has nothing to do with performance.
Most UI applications are broken real-time applications
11–20 of 151 posts
Re: Most UI applications are broken real-time applications
#12I like this perspective. In the demoscene days, we used to obsess over 60 Hz guaranteed framerates. Code was constantly being profiled using raster bars. Our effects might have been crappy, but all was buttery smooth. Then someone decided it would be a good idea to create a common user interface that would work on many different framerates and resolutions, and all was lost. Or people would try for complex 3D graphics…
> Code was constantly being profiled using raster bars. For those wondering: we'd change the background color from, say, black to blue for the "physics" part, to green for the "drawing" part, to purple for the "audio rendering" part... All in the same frame, while the frame was being drawn. So you'd see on the border of your screen (usually outside of the drawing area you'd have access to) approximately which percent…
Re: Most UI applications are broken real-time applications
#13> So correct UI applications cannot call any blocking function from their main threads. Author is redefining "correct" to mean "has the property I care about, which in this case is performance". There are many desirable distinct properties of a computer system: correctness, performance, security, etc. "Correct" usually means something like "gives the right answer". It has nothing to do with performance.
In my experience, "Correct" means "satisfies a specification". The specification is often about the final result, but it's not limited to it.
Re: Most UI applications are broken real-time applications
#14If this article is true, I wonder if newer frameworks like Android's Compose are fundamentally flawed, at least when used in languages with garbage collection. Essentially, composable can recompose with every frame, like for an animation. But, in certain circumstances, this will cause allocations for every frame. For example, a modifier that is scoped to something like BoxScope. You can't hoist it out of the composab…
Re: Most UI applications are broken real-time applications
#15I like this perspective. In the demoscene days, we used to obsess over 60 Hz guaranteed framerates. Code was constantly being profiled using raster bars. Our effects might have been crappy, but all was buttery smooth. Then someone decided it would be a good idea to create a common user interface that would work on many different framerates and resolutions, and all was lost. Or people would try for complex 3D graphics…
Re: Most UI applications are broken real-time applications
#16Earlier quoted context omitted.
> Code was constantly being profiled using raster bars. For those wondering: we'd change the background color from, say, black to blue for the "physics" part, to green for the "drawing" part, to purple for the "audio rendering" part... All in the same frame, while the frame was being drawn. So you'd see on the border of your screen (usually outside of the drawing area you'd have access to) approximately which percent…
Not just that. You hit a key and the game could react in literally the next frame. There was an immediacy you don't get now.
Re: Most UI applications are broken real-time applications
#17> when I realized that most mainstream desktop UI applications were fundamentally broken. Oh boy > File system IO functions belong to a class of functions called blocking functions. Hasn’t non-blocking IO been a major feature for about a decade now??
On some Windows machines with network-mounted drives, the File-Print-to-pdf dialog takes *minutes* to become responsive, even when all currently open files are on a local drive.
This is the kind of thing the author is talking about. The programmers of that dialog box probably just called a generic "open file dialog" library function, without researching its worst-case performance.
In turn the library writers probably blithely coded something like "check if all mounted drives are accessible", without stopping to consider the worst-case performance.
Re: Most UI applications are broken real-time applications
#18Re: Most UI applications are broken real-time applications
#19Earlier quoted context omitted.
> Code was constantly being profiled using raster bars. For those wondering: we'd change the background color from, say, black to blue for the "physics" part, to green for the "drawing" part, to purple for the "audio rendering" part... All in the same frame, while the frame was being drawn. So you'd see on the border of your screen (usually outside of the drawing area you'd have access to) approximately which percent…
Not just that. You hit a key and the game could react in literally the next frame. There was an immediacy you don't get now.
Re: Most UI applications are broken real-time applications
#20So I've pressed a button to load a file that's usually really fast and this time nothing happens because the async call is taking it's time. Is that being represented to the user in some meaningful way? Is the button disabled until the operation completes? Is it stuck in the down position to show I can't press it again, or does it spring back up and show a loading dialog? Is that any more clear in a real time system then it would be in a blocking situation?
The problem is not blocking vs realtime, it's about programmers not understanding all the state their code can run in, and it's not clear that a realtime system would save the user when they fall into that unknown state.