From: Nick Maclaren on

In article <4v3c8oF1as205U1(a)mid.individual.net>, Andrew Reilly <andrew-newspost(a)areilly.bpc-users.org> writes:
|> On Fri, 22 Dec 2006 19:23:29 +0000, Nick Maclaren wrote:
|>
|> > So I make it that the MINIMUM is 6 context switches for any character,
|> > and 10 for an upper-case or control character. And not all systems
|> > will do as well.
|>
|> Note that while the analysis is largely true, it is not, in fact, a
|> problem, because people don't type very quickly.

Edinburgh did some measurements. An hourly average of ORDINARY users
was 5 such actions a second. A professional or game-player is likely
to quadruple that.

|> One of the huge benefits
|> of modern, frame- and network based systems, compared to the tty-based
|> ones of yore, is that all of that effort does not scale linearly with the
|> amount of work involved: requests are batched in both directions. So the
|> task switching overhead winds up being significantly smaller than that,
|> ammortised over the large chunks of drawing effort that generally goes
|> on *after* the user has pressed and released said key.

In theory. When I last investigated, it was not so in practice. The
design of X is such that it is not, in general, likely to reduce the
event traffic by very much.

|> It's hard to imagine any client-server GUI model that could provide
|> the level of interactivity that applications and users require with fewer
|> domain crossings without cutting some pretty serious corners. ...

I can, easily :-)

|> Compare that to the old tty days, where the OS had to take an interrupt,
|> and maybe a context switch for *every* character in or out of the system.
|> And that didn't give you pretty icons or drop shadows...

Been there, seen that. It is one of the reasons that Cambridge (Phoenix),
Gothenberg (GUTS) and Mitchigan *MTS) managed to put so many more users
onto MVS-based systems than IBM could achieve. All of those alleviated
that problem in various ways.


Regards,
Nick Maclaren.
From: Nick Maclaren on

In article <emivjm$d4a$1(a)gemini.csx.cam.ac.uk>,
nmm1(a)cus.cam.ac.uk (Nick Maclaren) writes:
|> In article <4v3c8oF1as205U1(a)mid.individual.net>,
|> Andrew Reilly <andrew-newspost(a)areilly.bpc-users.org> writes:
|>
|> |> > So I make it that the MINIMUM is 6 context switches for any character,
|> |> > and 10 for an upper-case or control character. And not all systems
|> |> > will do as well.
|> |>
|> |> Note that while the analysis is largely true, it is not, in fact, a
|> |> problem, because people don't type very quickly.
|>
|> Edinburgh did some measurements. An hourly average of ORDINARY users
|> was 5 such actions a second. A professional or game-player is likely
|> to quadruple that.

I forgot to mention. That was for plain-text work. No drag-and-drop,
no drawing with the mouse, none of the really high event-rate activities.
Remember that, with many focus models, moving the mouse across windows
(even between sub-windows of a main window) is an event comparable to
a key stroke.

I never saw the raw data, so can't tell you the exact usage patterns
or the breakdown of event type. It could be remeasured easily enough,
by anyone capable of building an instrumented X Server :-)


Regards,
Nick Maclaren.
From: Andrew Reilly on
On Sat, 23 Dec 2006 10:49:04 +0000, Nick Maclaren wrote:

> I forgot to mention. That was for plain-text work. No drag-and-drop,
> no drawing with the mouse, none of the really high event-rate activities.
> Remember that, with many focus models, moving the mouse across windows
> (even between sub-windows of a main window) is an event comparable to
> a key stroke.

Well, sure. But the alternatives seem to be either reducing the available
modes of interaction, and the scope of applications, or moving some
chunk(s) of the GUI functionality across the wire and into the terminal.
Most people seem to like *more* interactivity and decoration, not less (I'm
a big fan of focus-follows-mouse, myself, despite all of the window
decoration re-draws that it implies). The latter option has been proposed
and offered several times over the years, and the only version that seems
to have been even remotely popular with applications developers is "run
the whole app on the terminal, and run database queries over the wire".
Cleaving off a thin GUI layer to run independent of the "application" seems
to be beyond most folks. Maybe that's where the javascript/Ajax thing is
going: make the display layer painful enough and programmers won't *want*
to put the whole application there... Maybe all of the previous
remote-able widget models were just broken in some way. Of course you can
easily *increase* your network load with database queries, compared to a
few key or mouse clicks...

> I never saw the raw data, so can't tell you the exact usage patterns
> or the breakdown of event type. It could be remeasured easily enough,
> by anyone capable of building an instrumented X Server

Very easily: run xev into a program that counts lines/second. It's pretty
high (particularly when mousing---not much otherwise), but I bet the
task-switch rate is lower than that of a web applications server
serving dynamic pages under high load.

Cheers,

--
Andrew
From: Nick Maclaren on

In article <4v4rokF1aokeiU1(a)mid.individual.net>, Andrew Reilly <andrew-newspost(a)areilly.bpc-users.org> writes:
|> On Sat, 23 Dec 2006 10:49:04 +0000, Nick Maclaren wrote:
|>
|> > I forgot to mention. That was for plain-text work. No drag-and-drop,
|> > no drawing with the mouse, none of the really high event-rate activities.
|> > Remember that, with many focus models, moving the mouse across windows
|> > (even between sub-windows of a main window) is an event comparable to
|> > a key stroke.
|>
|> Well, sure. But the alternatives seem to be either reducing the available
|> modes of interaction, and the scope of applications, or moving some
|> chunk(s) of the GUI functionality across the wire and into the terminal.

That is the choice, yes.

|> Most people seem to like *more* interactivity and decoration, not less (I'm
|> a big fan of focus-follows-mouse, myself, despite all of the window
|> decoration re-draws that it implies). ...

Most people seem to like junk food, modern television and pornography[*],
too. I am not sure what that proves.

|> Very easily: run xev into a program that counts lines/second. It's pretty
|> high (particularly when mousing---not much otherwise), but I bet the
|> task-switch rate is lower than that of a web applications server
|> serving dynamic pages under high load.

Not a fair comparison. Naturally a server will have more work to do
than a dedicated desktop.


[*] Most pornography is legal. Take a look at a dictionary definition
and much of what the gutter press, modern television and advertising.


Regards,
Nick Maclaren.
From: Andrew Reilly on
On Sat, 23 Dec 2006 14:34:44 +0000, Nick Maclaren wrote:

> I wrote:
> |> Very easily: run xev into a program that counts lines/second. It's pretty
> |> high (particularly when mousing---not much otherwise), but I bet the
> |> task-switch rate is lower than that of a web applications server
> |> serving dynamic pages under high load.
>
> Not a fair comparison. Naturally a server will have more work to do
> than a dedicated desktop.

Sure it's a fair comparison. The dedicated desktop has nothing better to
do than flip contexts for your pleasure. The only time when the
overhead is an issue is if you're trying to serve significant number of
people, xterminal+shared-server style. Hardly anyone does that any more,
so I guess everyone else has moved that GUI functionality out to the
terminal (i.e., dedicated desktop).

Cheers,

--
Andrew