Author Topic: Interesting article on keyboard latency  (Read 6607 times)

0 Members and 1 Guest are viewing this topic.

Offline dubious

  • 쏘쿨
  • Thread Starter
  • Posts: 573
  • Location: shralpin the gnar
Interesting article on keyboard latency
« on: Mon, 16 October 2017, 18:35:19 »
this was at the top of hackernews, as of this post  :))

https://danluu.com/keyboard-latency/

tl;dr

Most 'gaming' keyboards aren't actually faster than a regular keyboard, and older computer systems with less cruft in the signal pipeline have shorter latencies. Higher polling rates only add marginal improvements to latency, while keypresses (of the MX and the rubbery type) add a fairly significant delay to input.
« Last Edit: Mon, 16 October 2017, 18:40:22 by dubious »

Offline Zobeid Zuma

  • Posts: 262
  • Location: Texas
Re: Interesting article on keyboard latency
« Reply #1 on: Mon, 16 October 2017, 19:25:48 »
But he's measuring latency from the time the key starts moving, instead of from the switch actuation.  That might possibly make some kind of sense for gaming, but I don't think it's the right way to measure latency for typing.  It seems to me that it would make more sense to measure it from the moment the switch action is heard or felt, or both.  In other words, it should be related to the auditory and tactile feedback.

Offline algernon

  • Posts: 311
  • A tiny mouse, a hacker.
    • Diaries of a Madman
Re: Interesting article on keyboard latency
« Reply #2 on: Mon, 16 October 2017, 19:34:37 »
While the latency measurement is a commendable exercise, there are a few fundamental issues I have with the article. One of those is that it fails to account for layers: when you have layers (the type where you have transparency), looking up a key has a cost. This cost can vary depending on how many layers you have active, and how many of those are transparent. Thus, latency may vary from key to key, or from firmware to firmware, on the same hardware.

Offline Findecanor

  • Posts: 5036
  • Location: Koriko
Re: Interesting article on keyboard latency
« Reply #3 on: Tue, 17 October 2017, 04:48:18 »
Unless the firmware programmer is completely incompetent, using layers would be just one or a few indirect lookups. Yes, transparency would add more, but that would still be maybe only a dozen more CPU instructions. The added latency would be measured in tens of nanoseconds, not milliseconds.
Compare that to debouncing, which is at least five milliseconds and often more to account for the odd bad switch.

Offline Coreda

  • Posts: 776
Re: Interesting article on keyboard latency
« Reply #4 on: Tue, 17 October 2017, 06:26:03 »
Those Apple boards gets a lot of flak but funnily enough come out on top in this small sample of latency tests.

Edit:

But he's measuring latency from the time the key starts moving, instead of from the switch actuation.

This would explain the discrepancy.


Offline algernon

  • Posts: 311
  • A tiny mouse, a hacker.
    • Diaries of a Madman
Re: Interesting article on keyboard latency
« Reply #6 on: Tue, 17 October 2017, 08:05:46 »
Unless the firmware programmer is completely incompetent, using layers would be just one or a few indirect lookups. Yes, transparency would add more, but that would still be maybe only a dozen more CPU instructions. The added latency would be measured in tens of nanoseconds, not milliseconds.
Compare that to debouncing, which is at least five milliseconds and often more to account for the odd bad switch.

You'd be surprised! I know I was when I discovered how slow layer lookups can be. You need to compare the keycode, a 16-bit integer, typically on a 8-bit MCU, so that's going to take more than one instruction. To do this, you will first have to look up the key, which is in PROGMEM, so it's a little more involved than just reading from memory (1 more cycle, as far as I remember). Then do this for every layer, top to bottom, until you find a non-transparent one. So all of the previous, times 32 in the worst case. For every single key.

For comparsion, if we take lookup from PROGMEM as baseline, and assume a keyboard with 87 keys, a naive implementation of layering will do this lookup 31 times more than without layers. Even if this'd be a single instruction, we are still looking at 31 more, and they are much more expensive than that. Luckily, almost no firmware I know of does this, but few manage to do it fast. Just looking up from PROGMEM, we are looking at almost 2700 extra cycles. Add the comparsion, the loop increment, the stop-condition check, and we are easily looking at ~10k extra cycles, which is getting into millisecond territory. A single key pressed may not take all that much time, but when you keep hammering on the keyboard, it adds up. Especially if you want to handle not just press & release, but all states, including being held and continuing to be released, because in this case, you can't cheat by only doing the lookup for keys that were pressed or released - you have to do it for all of them.

For example, QMK (and if I remember correctly, TMK too) will do a full scan over all 32 layers on each keypress. They'll cache the results until the next press of the same key, so releasing the key, or looking it up while held for whatever reason will be a much cheaper operation. But on keypress, it still goes through every layer, with all the penalties applied. Even for a single key press, we are looking at well over a hundred instructions, considerably more than a few dozen. Pressing more keys, or wanting to handle not just keys that changed state, but those that remained at their previous one will quickly push the cost up high.

In Kaleidoscope, we take this a few steps further, and we do more aggressive caching (not going into details here, poke me if interested), so key lookup becomes a single load from SRAM, regardless of how many layers one has. Going from naive to single load from SRAM got us down from >10ms main loop cycles (matrix scan & event handling, debounce not included) to ~2.7ms loops.

In short, looking up keys on a layer has non-trivial costs. It may be a few dozen instructions per key, but when you have to do that for every key on the keyboard, each cycle, there will be a noticable impact. If you add some special flavour (oneshot keys, macros, and so on), you are looking at even higher costs, all of which the article doesn't care about, thus making the comparisons a lot less useful.

Offline Findecanor

  • Posts: 5036
  • Location: Koriko
Re: Interesting article on keyboard latency
« Reply #7 on: Tue, 17 October 2017, 13:29:22 »
So all of the previous, times 32 in the worst case. For every single key.

For comparsion, if we take lookup from PROGMEM as baseline, and assume a keyboard with 87 keys, a naive implementation of layering will do this lookup 31 times more than without layers.
If you press down 87 keys at once within the same USB millisecond "cycle", you could run into other effects anyway.

If I remember correctly, TMK and a few other firmwares will go directly to reporting (and flagging the report for "interrupt" pickup in the next poll by the host) after the first new key press or release it detects. So, there is at most one recursive lookup before that key press is reported. But the next key press will be delayed, and then the next even more, etc.

If you are using a report format with an array (such as the classic 6KRO protocol), unless you keep track of ACK's from the host to events (which PJRC's USB code for 8-bit AVR doesn't), then key presses detected earlier could be pushed out from the array by other key presses before the host has polled it -- thus never being detected.

Host operating systems are limited in the number of key events they can process per report (source: "Engineer Dan" on tumblr.. unfortunately  that site is gone and not on archive.org, so I can't link to it.). MS Windows is limited to 36 events per report but MacOS is limited to only 8.

This means that a little delay when you have many key presses at once is probably actually something desirable.

Anyway...
How do you enter a layer? From another layer of course. And the layer stack can only grow and shrink at the top - not in the middle. Right?
If you have those properties, then you should be able to plot all possible layer combinations in a directed graph - which if you copy layers, could be generalised as a tree.
If you do this then you should be able to precompute all "transparent" keys at the host side before you program the microcontroller - and then you could get O(1) lookup.

Offline dubious

  • 쏘쿨
  • Thread Starter
  • Posts: 573
  • Location: shralpin the gnar
Re: Interesting article on keyboard latency
« Reply #8 on: Tue, 17 October 2017, 14:22:41 »
But he's measuring latency from the time the key starts moving, instead of from the switch actuation.  That might possibly make some kind of sense for gaming, but I don't think it's the right way to measure latency for typing.  It seems to me that it would make more sense to measure it from the moment the switch action is heard or felt, or both.  In other words, it should be related to the auditory and tactile feedback.

The author does address why he chose that method, and I understand it's not he most precise form of measurement. However, they do account for the average switch travel time, and there is still significant latency in modern keyboards even without this delay.

While the latency measurement is a commendable exercise, there are a few fundamental issues I have with the article. One of those is that it fails to account for layers: when you have layers (the type where you have transparency), looking up a key has a cost. This cost can vary depending on how many layers you have active, and how many of those are transparent. Thus, latency may vary from key to key, or from firmware to firmware, on the same hardware.

I don't really think it's a fundamental issue with the article, layers are just another variable in the signal chain that the author didn't investigate. It would be interesting to see how much layers add to latency in practice. But the average computer user doesn't even know what keyboard layers are, and it wouldn't be relative to the argument that modern keyboards/computer systems have more signal latency than their older relatives.

Offline FoxWolf1

  • Posts: 850
  • 154
Re: Interesting article on keyboard latency
« Reply #9 on: Tue, 17 October 2017, 15:46:19 »
I feel like there's a big difference between latency that's due to the physical characteristics of the switch is different from latency that's due to the electronic characteristics of the switch (and keyboard a a whole) because there are various tradeoffs involved in the physical design of the switch travel.

For example, moving the activation point up may give a switch a faster initial response, but at the cost of both a) increased delay when releasing the switch from full travel, and b) increased frequency of accidental keypresses. A) can be counteracted by reducing the over-travel as well (thus reducing the travel of the entire switch), but then the keys will bottom out sooner-- thus harder and more often, leading to decreased comfort. Unless you start doing nutty, so-far-purely-theoretical things like using analog sensing to "break" these tradeoffs (by doing things like having a key release as soon as it detects significant upwards motion, and then be able to re-activate on any significant downwards motion), pursuing speed through altered physical characteristics means significant sacrifices.

On the other hand, if there were no electronic delay whatsoever, that'd be wonderful.

This message typed on my Hall Effect keyboard.
Oberhofer Model 1101 | PadTech Hall Effect (Prototype) | RK RC930-104 v2 | IBM Model M | Noppoo TANK | Keycool Hero 104

Offline Findecanor

  • Posts: 5036
  • Location: Koriko
Re: Interesting article on keyboard latency
« Reply #10 on: Tue, 17 October 2017, 16:16:25 »
Overtravel could also be counteracted by using a spring with a steeper force increase.

Speed as actuation is how pianos and mechanical typewriters work. You do not get a tone/a letter imprint if you press a key slowly.

Offline algernon

  • Posts: 311
  • A tiny mouse, a hacker.
    • Diaries of a Madman
Re: Interesting article on keyboard latency
« Reply #11 on: Tue, 17 October 2017, 17:01:38 »
So all of the previous, times 32 in the worst case. For every single key.

For comparsion, if we take lookup from PROGMEM as baseline, and assume a keyboard with 87 keys, a naive implementation of layering will do this lookup 31 times more than without layers.
If you press down 87 keys at once within the same USB millisecond "cycle", you could run into other effects anyway.

You don't have to press all 87 at the same time in order to need to look them all up. For a number of reasons, the firmware I'm most familiar with will look up each key every cycle. This allows us to implement features that wouldn't be possible if we only handled press & release events. To be able to handle held and continuous release events, we need to check every key, every cycle, and that will involve a lookup.

Anyway...
How do you enter a layer? From another layer of course. And the layer stack can only grow and shrink at the top - not in the middle. Right?
If you have those properties, then you should be able to plot all possible layer combinations in a directed graph - which if you copy layers, could be generalised as a tree.
If you do this then you should be able to precompute all "transparent" keys at the host side before you program the microcontroller - and then you could get O(1) lookup.

I imagine such a tree would take quite a bit of space, which is severely limited on most keyboards. There are more efficient solutions that result in the same O(1) lookup that require less space on the keyboard.

Offline obfuscated

  • Posts: 10
Re: Interesting article on keyboard latency
« Reply #12 on: Tue, 17 October 2017, 17:36:19 »
I imagine such a tree would take quite a bit of space, which is severely limited on most keyboards. There are more efficient solutions that result in the same O(1) lookup that require less space on the keyboard.

Why bother with a tree? Just bake all layers. This is n x m bytes (n is the number of keys, m is the number of bytes). Or for example 3200 bytes for 100 key, 32 layer keyboard. I don't see this becoming a problem for the typical atmega32ur4 mcu with 32kb of flash.

Offline algernon

  • Posts: 311
  • A tiny mouse, a hacker.
    • Diaries of a Madman
Re: Interesting article on keyboard latency
« Reply #13 on: Tue, 17 October 2017, 18:12:16 »
I imagine such a tree would take quite a bit of space, which is severely limited on most keyboards. There are more efficient solutions that result in the same O(1) lookup that require less space on the keyboard.

Why bother with a tree? Just bake all layers. This is n x m bytes (n is the number of keys, m is the number of bytes). Or for example 3200 bytes for 100 key, 32 layer keyboard. I don't see this becoming a problem for the typical atmega32ur4 mcu with 32kb of flash.

Err, no, you can't do that the way you think. Just baking all layers in is not how they work. I can have layers 0, 4 and 7 active, without the rest. Or I can have 0, 5 and 7. If layer 7 has transparent keys, they might resolve differently depending on what other layers you have active. So you'd have to bake in all combinations. That... is a lot more data. Completely useless too, because we can pre-compute the active resolutions when switching layers, thus incurring a small penalty, and sacrifice a bit of SRAM, but make lookups as fast as they can be (O(1), ~2 MCU cycles / key).

Offline tp4tissue

  • * Destiny Supporter
  • Posts: 13565
  • Location: Official Geekhack Public Defender..
  • OmniExpert of: Rice, Top-Ramen, Ergodox, n Females
Re: Interesting article on keyboard latency
« Reply #14 on: Tue, 17 October 2017, 18:46:49 »
This latency doesn't really matter.. because input windows for any human related tasks is never held down to 100ms..


It'd be nice to do better.. But it's not a requirement..




Offline dubious

  • 쏘쿨
  • Thread Starter
  • Posts: 573
  • Location: shralpin the gnar
Re: Interesting article on keyboard latency
« Reply #15 on: Tue, 17 October 2017, 19:01:53 »
This latency doesn't really matter.. because input windows for any human related tasks is never held down to 100ms..


It'd be nice to do better.. But it's not a requirement..

I believe the '100 ms' you are mentioning is considered the quickest possible human reaction time, but that has nothing to do with the delay after you have reacted and pressed the switch.

Offline pomk

  • Posts: 470
  • Location: Finland
Re: Interesting article on keyboard latency
« Reply #16 on: Wed, 18 October 2017, 03:15:11 »
This latency doesn't really matter.. because input windows for any human related tasks is never held down to 100ms..


It'd be nice to do better.. But it's not a requirement..
I’d rather have my reactions show inside the game some 3 frames earlier if possible.

Offline tp4tissue

  • * Destiny Supporter
  • Posts: 13565
  • Location: Official Geekhack Public Defender..
  • OmniExpert of: Rice, Top-Ramen, Ergodox, n Females
Re: Interesting article on keyboard latency
« Reply #17 on: Wed, 18 October 2017, 10:43:54 »
This latency doesn't really matter.. because input windows for any human related tasks is never held down to 100ms..


It'd be nice to do better.. But it's not a requirement..
I’d rather have my reactions show inside the game some 3 frames earlier if possible.


Yea, we would all like to have 14x supermodel girlfriends on a 14 day rotation.

But you know.. It's NOT PRACTICAL,  and there's nothing you can accomplish with 14x, that you couldn't accomplish with 4x.


So I think very generally,  there is a cutoff for good enough at 4x..


Offline tp4tissue

  • * Destiny Supporter
  • Posts: 13565
  • Location: Official Geekhack Public Defender..
  • OmniExpert of: Rice, Top-Ramen, Ergodox, n Females
Re: Interesting article on keyboard latency
« Reply #18 on: Wed, 18 October 2017, 10:47:16 »
This latency doesn't really matter.. because input windows for any human related tasks is never held down to 100ms..


It'd be nice to do better.. But it's not a requirement..

I believe the '100 ms' you are mentioning is considered the quickest possible human reaction time, but that has nothing to do with the delay after you have reacted and pressed the switch.


What you can notice is different from DOES IT MATTER..

Let's say you ordered lunch, and it came in 10 minutes today. Great..

The next day you ordered lunch,  it came in 11 minutes..  Not as good, but given the OTHER types of inefficiencies that come with HUMAN ORDEALS..   if you can tolerate 1 minute..   14ms 50ms 100ms..  It's really OK..   If you'd spend one minute less playing overwatch today, you get 60000 ms back.


This isn't to say we should never improve,  it's merely to say, If we're going to work on something, we have to be more cognizant and initiate effort in the right places.. rather than frivolously.

Offline joey

  • Posts: 2296
  • Location: UK
Re: Interesting article on keyboard latency
« Reply #19 on: Wed, 18 October 2017, 10:53:04 »
In Kaleidoscope, we take this a few steps further, and we do more aggressive caching (not going into details here, poke me if interested), so key lookup becomes a single load from SRAM, regardless of how many layers one has. Going from naive to single load from SRAM got us down from >10ms main loop cycles (matrix scan & event handling, debounce not included) to ~2.7ms loops.

Can you point that out? Somewhere here: https://github.com/keyboardio/Kaleidoscope/tree/master/src ?

Offline algernon

  • Posts: 311
  • A tiny mouse, a hacker.
    • Diaries of a Madman
Re: Interesting article on keyboard latency
« Reply #20 on: Wed, 18 October 2017, 11:16:47 »
In Kaleidoscope, we take this a few steps further, and we do more aggressive caching (not going into details here, poke me if interested), so key lookup becomes a single load from SRAM, regardless of how many layers one has. Going from naive to single load from SRAM got us down from >10ms main loop cycles (matrix scan & event handling, debounce not included) to ~2.7ms loops.

Can you point that out? Somewhere here: https://github.com/keyboardio/Kaleidoscope/tree/master/src ?

This is a good starting point, I believe. The pull request that implemented this may also be of interest.

Offline pomk

  • Posts: 470
  • Location: Finland
Re: Interesting article on keyboard latency
« Reply #21 on: Wed, 18 October 2017, 11:43:15 »
This latency doesn't really matter.. because input windows for any human related tasks is never held down to 100ms..


It'd be nice to do better.. But it's not a requirement..
I’d rather have my reactions show inside the game some 3 frames earlier if possible.


Yea, we would all like to have 14x supermodel girlfriends on a 14 day rotation.

But you know.. It's NOT PRACTICAL,  and there's nothing you can accomplish with 14x, that you couldn't accomplish with 4x.


So I think very generally,  there is a cutoff for good enough at 4x..
Winning is not practical? Maybe for losers.
In a reaction game who would you bet on? A person with an effective total reaction time of 150ms or someone with a total reaction time of 100ms ?

Offline tp4tissue

  • * Destiny Supporter
  • Posts: 13565
  • Location: Official Geekhack Public Defender..
  • OmniExpert of: Rice, Top-Ramen, Ergodox, n Females
Re: Interesting article on keyboard latency
« Reply #22 on: Wed, 18 October 2017, 11:45:46 »
This latency doesn't really matter.. because input windows for any human related tasks is never held down to 100ms..


It'd be nice to do better.. But it's not a requirement..
I’d rather have my reactions show inside the game some 3 frames earlier if possible.


Yea, we would all like to have 14x supermodel girlfriends on a 14 day rotation.

But you know.. It's NOT PRACTICAL,  and there's nothing you can accomplish with 14x, that you couldn't accomplish with 4x.


So I think very generally,  there is a cutoff for good enough at 4x..
Winning is not practical? Maybe for losers.
In a reaction game who would you bet on? A person with an effective total reaction time of 150ms or someone with a total reaction time of 100ms ?


You're diluting the game down to a single pivot point. That is not a realistic argument..

No games that humans would productively play , is dependent on 100ms inputs.


You could certainly invent such a game, or impose such conditions on an existing game.

But again,  not realistic,  and to no purpose.

Offline pomk

  • Posts: 470
  • Location: Finland
Re: Interesting article on keyboard latency
« Reply #23 on: Wed, 18 October 2017, 11:52:26 »
This latency doesn't really matter.. because input windows for any human related tasks is never held down to 100ms..


It'd be nice to do better.. But it's not a requirement..
I’d rather have my reactions show inside the game some 3 frames earlier if possible.


Yea, we would all like to have 14x supermodel girlfriends on a 14 day rotation.

But you know.. It's NOT PRACTICAL,  and there's nothing you can accomplish with 14x, that you couldn't accomplish with 4x.


So I think very generally,  there is a cutoff for good enough at 4x..
Winning is not practical? Maybe for losers.
In a reaction game who would you bet on? A person with an effective total reaction time of 150ms or someone with a total reaction time of 100ms ?


You're diluting the game down to a single pivot point. That is not a realistic argument..

No games that humans would productively play , is dependent on 100ms inputs.


You could certainly invent such a game, or impose such conditions on an existing game.

But again,  not realistic,  and to no purpose.
Counter strike? One person watching a corner and another trying to peek? A very common engagement in the game and is very much about pure reaction time.

Offline joey

  • Posts: 2296
  • Location: UK
Re: Interesting article on keyboard latency
« Reply #24 on: Wed, 18 October 2017, 11:59:51 »
In Kaleidoscope, we take this a few steps further, and we do more aggressive caching (not going into details here, poke me if interested), so key lookup becomes a single load from SRAM, regardless of how many layers one has. Going from naive to single load from SRAM got us down from >10ms main loop cycles (matrix scan & event handling, debounce not included) to ~2.7ms loops.

Can you point that out? Somewhere here: https://github.com/keyboardio/Kaleidoscope/tree/master/src ?

This is a good starting point, I believe. The pull request that implemented this may also be of interest.
Thanks, think I understand it!

My firmware barely supports layers (it's not committed and it doesn't support 'transparent' keys), but I'm trying to keep it as simple as possible for the first implementation!

Offline tp4tissue

  • * Destiny Supporter
  • Posts: 13565
  • Location: Official Geekhack Public Defender..
  • OmniExpert of: Rice, Top-Ramen, Ergodox, n Females
Re: Interesting article on keyboard latency
« Reply #25 on: Wed, 18 October 2017, 12:04:15 »

You're diluting the game down to a single pivot point. That is not a realistic argument..

No games that humans would productively play , is dependent on 100ms inputs.


You could certainly invent such a game, or impose such conditions on an existing game.

But again,  not realistic,  and to no purpose.
Counter strike? One person watching a corner and another trying to peek? A very common engagement in the game and is very much about pure reaction time.

Nope.. the entire online pipe for CSGO is around 150 to 500 end to end.

So 100ms is not relevant.


This doesn't even account for your display latency, + your frame time, dropped frames, Screen tearing latency difference between top and bottom of screen, etc



Offline pomk

  • Posts: 470
  • Location: Finland
Re: Interesting article on keyboard latency
« Reply #26 on: Wed, 18 October 2017, 12:11:46 »

You're diluting the game down to a single pivot point. That is not a realistic argument..

No games that humans would productively play , is dependent on 100ms inputs.


You could certainly invent such a game, or impose such conditions on an existing game.

But again,  not realistic,  and to no purpose.
Counter strike? One person watching a corner and another trying to peek? A very common engagement in the game and is very much about pure reaction time.

Nope.. the entire online pipe for CSGO is around 150 to 500 end to end.

So 100ms is not relevant.


This doesn't even account for your display latency, + your frame time, dropped frames, Screen tearing latency difference between top and bottom of screen, etc
So you are saying that going form 150 to 500 end to end to 100 to 450 end to end will not give any advantage?  :))
I believe you would notice your ping going up 50 ms, which would have the same effect here as far as reaction times go.
« Last Edit: Wed, 18 October 2017, 12:16:10 by pomk »

Offline tp4tissue

  • * Destiny Supporter
  • Posts: 13565
  • Location: Official Geekhack Public Defender..
  • OmniExpert of: Rice, Top-Ramen, Ergodox, n Females
Re: Interesting article on keyboard latency
« Reply #27 on: Wed, 18 October 2017, 12:15:29 »

You're diluting the game down to a single pivot point. That is not a realistic argument..

No games that humans would productively play , is dependent on 100ms inputs.


You could certainly invent such a game, or impose such conditions on an existing game.

But again,  not realistic,  and to no purpose.
Counter strike? One person watching a corner and another trying to peek? A very common engagement in the game and is very much about pure reaction time.

Nope.. the entire online pipe for CSGO is around 150 to 500 end to end.

So 100ms is not relevant.


This doesn't even account for your display latency, + your frame time, dropped frames, Screen tearing latency difference between top and bottom of screen, etc
So you are saying that going form 150 to 500 end to end to 100 to 450 end to end will not give any advantage?  :))


Hahahahaha.

you have 2 cars, off the same assembly line.  ONE will go slightly faster than the other..

But it's unrealistic to say that the slightly faster car will always win in a race, even Driven by the same driver..


Because OTHER FACTORS of the game or test influences the game far more than that very slight difference.


Again, you guys are confounding   "Is there a difference"  with  "Does it matter"


The flow for video game input goes like this:

Is there a difference in latency-> Yes -> Does it matter -> No -> which keyboard to buy -> the White one because it matches your mouse..


Offline pomk

  • Posts: 470
  • Location: Finland
Re: Interesting article on keyboard latency
« Reply #28 on: Wed, 18 October 2017, 12:17:14 »

You're diluting the game down to a single pivot point. That is not a realistic argument..

No games that humans would productively play , is dependent on 100ms inputs.


You could certainly invent such a game, or impose such conditions on an existing game.

But again,  not realistic,  and to no purpose.
Counter strike? One person watching a corner and another trying to peek? A very common engagement in the game and is very much about pure reaction time.

Nope.. the entire online pipe for CSGO is around 150 to 500 end to end.

So 100ms is not relevant.


This doesn't even account for your display latency, + your frame time, dropped frames, Screen tearing latency difference between top and bottom of screen, etc
So you are saying that going form 150 to 500 end to end to 100 to 450 end to end will not give any advantage?  :))


Hahahahaha.

you have 2 cars, off the same assembly line.  ONE will go slightly faster than the other..

But it's unrealistic to say that the slightly faster car will always win in a race, even Driven by the same driver..


Because OTHER FACTORS of the game or test influences the game far more than that very slight difference.
Yes there is more than one factor of course. Dismissing them all because n is larger than one is just silly. On average the one with a lower ping / other latency will win.

Offline tp4tissue

  • * Destiny Supporter
  • Posts: 13565
  • Location: Official Geekhack Public Defender..
  • OmniExpert of: Rice, Top-Ramen, Ergodox, n Females
Re: Interesting article on keyboard latency
« Reply #29 on: Wed, 18 October 2017, 12:20:57 »

Hahahahaha.

you have 2 cars, off the same assembly line.  ONE will go slightly faster than the other..

But it's unrealistic to say that the slightly faster car will always win in a race, even Driven by the same driver..


Because OTHER FACTORS of the game or test influences the game far more than that very slight difference.
Yes there is more than one factor of course. Dismissing them all because n is larger than one is just silly. On average the one with a lower ping / other latency will win.


Hahahaha, you need to go back to skool.. hahahahaha

The only thing that the lower measured latency tells us... is... On average it has lower latency...



That is it,  every other prediction you can make is frivolous..

Offline pomk

  • Posts: 470
  • Location: Finland
Re: Interesting article on keyboard latency
« Reply #30 on: Wed, 18 October 2017, 12:23:14 »

Hahahahaha.

you have 2 cars, off the same assembly line.  ONE will go slightly faster than the other..

But it's unrealistic to say that the slightly faster car will always win in a race, even Driven by the same driver..


Because OTHER FACTORS of the game or test influences the game far more than that very slight difference.
Yes there is more than one factor of course. Dismissing them all because n is larger than one is just silly. On average the one with a lower ping / other latency will win.


Hahahaha, you need to go back to skool.. hahahahaha

The only thing that the lower measured latency tells us... is... On average it has lower latency...



That is it,  every other prediction you can make is frivolous..
lol OK. Next you are going to say that a lower latency mouse/display/internet/cpu/whatever is meaningless as well.

Offline obfuscated

  • Posts: 10
Re: Interesting article on keyboard latency
« Reply #31 on: Wed, 18 October 2017, 14:00:25 »
First you say this:

In short, looking up keys on a layer has non-trivial costs. It may be a few dozen instructions per key, but when you have to do that for every key on the keyboard, each cycle, there will be a noticable impact....

And then you say this:
... thus incurring a small penalty, and sacrifice a bit of SRAM, but make lookups as fast as they can be (O(1), ~2 MCU cycles / key).

You're contradicting yourself...  ;D

I guess the conclusion is: looking up keys doesn't affect latency much (at least for simple keys and for transparent layers)...

About the article:
One conclusion in the article which is strange to me is that the author compares modern systems with his apple 2 and concludes that the modern system is slower because the physical movement of the key takes the majority of the time, but the old system has the same key travel or longer...

Switches in apple 2 for reference: https://deskthority.net/wiki/Datanetics_DC-50_series

Offline algernon

  • Posts: 311
  • A tiny mouse, a hacker.
    • Diaries of a Madman
Re: Interesting article on keyboard latency
« Reply #32 on: Wed, 18 October 2017, 14:25:15 »
First you say this:

In short, looking up keys on a layer has non-trivial costs. It may be a few dozen instructions per key, but when you have to do that for every key on the keyboard, each cycle, there will be a noticable impact....

And then you say this:
... thus incurring a small penalty, and sacrifice a bit of SRAM, but make lookups as fast as they can be (O(1), ~2 MCU cycles / key).

You're contradicting yourself...  ;D


If you take it out of context, yes. The first refers to most implementations I've seen, where lookup has a noticable impact. The second refers to a very optimized implementation.

FYI, completely removing lookup does have an impact even in the highly optimized case too. (It also renders the keyboard useless, but still :p)

Quote
I guess the conclusion is: looking up keys doesn't affect latency much (at least for simple keys and for transparent layers)...

Depends on how often, and how many keys you are looking up. One lookup is negligible. 64 lookups per cycle aren't.

Offline Findecanor

  • Posts: 5036
  • Location: Koriko
Re: Interesting article on keyboard latency
« Reply #33 on: Wed, 18 October 2017, 14:43:51 »
Games on 8-bit computers were more responsive because:
1) When you made a game for a 8-bit machines or even a 16-bit machine, everything was done by your own program -- because OS routines were too slow!
There were no USB controllers with microcontrollers running their own firmware, no drivers, no input queues - you bit-banged everything directly and did not have to cater to anything else but your own game.

The machine was practically completely deterministic: different users did not have different CPU:s, core counts, RAM speeds or graphics cards with different driver/firmware revisions. Every machine was exactly the same.
Everything was typically done in a main loop fixed to the 60 or 50 Hz refresh rate of the screen. You would know how many cycles you had in that loop, and could tune your program to a cycle budget per frame.
You wrote the code in hand-optimised machine code to get the code as fast as possible, and sometimes you had to time each and every instruction in a routine to sync with the screen to get around hardware limitations such as the number of available sprites or to swap graphics mode mid-screen.
If your game used the keyboard (which wasn't that common), it was typically only a single key or a few: and you would typically strobe only one column instead of scanning the whole keyboard.

2) The games were connected to CRTs, that updated the screen in real time and the game program was completely in sync with the CRT's refresh rate.
Modern LCD monitors delay the image up ten milliseconds. Some LCD televisions may delay the image even more, post-processing the image with "smart" upscaling, comb filters and whatnot.
« Last Edit: Wed, 18 October 2017, 14:57:00 by Findecanor »