
Messages in this thread
SubjectRe: uniform input device packets?
On 1998.06.25, Albert D. Cahalan <> wrote:
> Oh, the bitfields are insane. This is local kernel --> app data
> transfer, caused by a human. It's not networking over a modem.
> It is better to just make everything 32-bit. If performance is
> really an issue, think about all the bitshifting you can avoid.

Well, let me put forth the question - what's more expensive
computationally, a bitshift or bitwise-and, or a 4-byte

I'd rather read 2 bytes and mangle their bits around rather than
having to, say, read 16 bytes to obtain the same amount of data.
Unless, you can tell me that it's faster to just read the 16

Also, since we'll need to buffer these events in memory until
they're drained from the queue - having to queue 16 bytes per
event is *SO* wasteful of system resources (especially with
a large number of devices in this system). Say each device
queue is 16-events large (I *believe* this is what the PC
keyboard BIOS driver does, somewhere around 16 events). At
16-bytes an event, you're allocating a whole 256 bytes to
this queue. At 3 or even 4 bytes per event, you're only
using like 64 bytes per queue. Sounds like small numbers,
but depending on how large each event is, it adds up.



the body of a message to

 \ /
  Last update: 2005-03-22 13:43    [W:0.077 / U:0.116 seconds]
©2003-2011 Jasper Spaans