[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Plex86-devel] Task #1356...

From: Drew Northup
Subject: [Plex86-devel] Task #1356...
Date: Mon, 26 Aug 2002 14:27:09 -0400 (EDT)

I don't care about the code in care about the code in gets run each time that a key is pressed.  I agree that
I slightly misstated the problem--I'll fix that.  The problem is that
there isn't an optimised data structure holding the key data for each key.
In the case of what we have, the best way that I can see to do this is
just to make each keymap into a library.  The other problem with the way
that keymapping is set up is that the paste code is part of the keyboard
code in the current implementation.  This is _a_very_bad_idea_.  The paste
code is, by necessity, going to need different key translation than the
keyboard, and thus it should be translated separately.  There are, of
course, a couple of ways to go about this.  From what I can tell at the
moment, what we are doing for the paste is roughly the equivalent of
parsing a file (in memory) each time a key is pressed.  For the standard
keypresses, the code seems to be cleaner, but to be honest it isn't
usually a good idea to have tables like that static in memory--due to the
way that CPU cache works primarily.  What makes more sense from an
optimised code point of view, is to have the keymap coded directly into
inline code on compile.  I know that this wipes out the chance of some
cute functionality toys (like dynamic re-mapping to an unknown keymap),
but it makes the runtime of the code so much faster.  Every time that you
index by a variable (or even constant) amount into a large static array
you suffer many many cache hits and context changes in the host
CPU--generally a bad idea.  Also, just having the array in memory when it
doesn't really need to be in some separate variable space (since it may be
part of code somewhere anyway) is a costly penalty in and of itself.  I'll
quit ranting now (for a moment) and let that get tossed around a bit.

> Today's Topics:
>    1. Task #1356: No need to worry (Eric Laberge)
> --__--__--
> Message: 1
> From: Eric Laberge <address@hidden>
> Reply-To: address@hidden
> To: address@hidden
> Date: Thu, 22 Aug 2002 11:54:07 -0400
> Subject: [Plex86-devel] Task #1356: No need to worry
> Aloha!
> I agree looks ugly, but the ugly part is only done on=20
> initialization. Code that is performed only once should not be candidate =
> for=20
> optimization.
> When there is a keypress, only getKeyXwin is called, which scans through =
> a=20
> table to find the corresponding keys. Considering the relatively few numb=
> er=20
> of key combinations in latin languages, it still is very fast.
> Well, maybe our chinese friends will have to wait a microsecond more when=
>  they=20
> press a key, but I guess it won't really matter.
> This looks to me like a false alarm.
> Though somebody should make an auto-keymap generator, just like these joy=
> stick=20
> calibration software, ie.: "Press a key, it will be mapped to Esc".
> EL
> --=20
> Eric Laberge
> Jabber ID: address@hidden
> GCS/M/S d-(++) s-: a-- C++(++++) UL+++>$ !P L++ E--- W++ N+ w++ !O M
> !V PS PE Y PGP-(+++) t++(-) X- R* tv+ b+ DI+++  D+ G e+>+++++ h! r--
> --__--__--
> _______________________________________________
> Plex86-devel mailing list
> address@hidden
> End of Plex86-devel Digest

|^^^ |  | |^^| |^^^  Drew Northup, N1XIM  |^^| |    |^^^ \  / /^^\ /^^~
|__  |  | |  | |                          |__| |    |___  \/  |__| |__
   | |  | |  | |  |    |    |     /\  |  | |  \
___| |__| |__| |___    |    |___ |___ /  \ \__/ \__/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]