pqrs-org / Karabiner-Elements

Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.
https://pqrs.org/osx/karabiner/
The Unlicense
18.58k stars 834 forks source link

Latency measurements? #2875

Open tbenthompson opened 2 years ago

tbenthompson commented 2 years ago

Hello,

I find small increases in typing latency to have a noticeable effect on my accuracy and speed. I'm a bit worried using Karabiner because I'm unable to find any numbers on the latency introduced by it. Of course it's going to be non-zero, but are we talking 10us, 100us, 1ms, 10ms? Has anyone done component or end-to-end benchmarks? I'm assuming it's not over 20 or 30ms otherwise lots of people would be noticing and commenting.

Thanks and I'm just curious!

tbenthompson commented 2 years ago

I did some extremely rough end-to-end measurements by taking videos with my iphone on slow motion mode at 240fps. Each frame is a little over 4ms. I counted how many frames between bottoming out on a keypress and seeing the character on the screen. I get an average of 28ms (or seven frames) regardless of whether Karabiner is activated or not. I have four complex modifications enabled and three simple mappings. Not the most rigorous test, but it confirms that Karabiner is not doing anything crazy.

vitvly commented 2 years ago

Been also wondering about it! There might also be a difference between mapping types, e.g. application-specific mappings perhaps.

tbenthompson commented 2 years ago

Yeah, I would love to see a suite of performance tests with decent coverage! Unfortunately, I’m not the person to work on that.