News for hackers. Stuff that matters.
Re:Typometer: A tool to measure and analyze the visual laten... by PragmaticPulp on Saturday July 25, 2020 @08:35PM (#23953475)
I'm all for faster software, but input lag measurements need to be put in perspective. Just because an editor can process an input in 3ms doesn't mean the pixels will change on your screen in 3ms.

If you're using a 60Hz monitor, you're only going to see new frames every 17ms at most (1 second / 60Hz). Your graphics pipeline might have some additional buffering, adding 10s of milliseconds of lag. Your monitor likely has some input processing as well, adding anywhere from 10-20ms before it sends the frame to the physical display. Add a few milliseconds here and there for input processing and even the response time of the physical pixels, and you're looking at something like 50-60ms minimum for total display latency before you factor in the software.

Using 144Hz FreeSync or G-Sync monitors can shorten that update time, but you're still looking at 30ms end-to-end latency in even the fastest setups, and that's before you account for software processing lag.

The difference between Sublime Text responding in 11.4ms average and Atom responding in 28.4ms average is difference of almost exactly 1 frame of latency for a typical 60Hz monitor. Add up all of the other sources of lag (buffering, monitor input lag) and you're looking at something like a 5 frame latency instead of a 4 frame latency. Still less than the blink of an eye (literally).

From another perspective: If you really believe that you're sensitive enough to feel a difference between something like Sublime Text's 11ms processing latency vs. Atom's 28ms latency, then you might want to invest in a proper 144Hz gaming monitor with low input lag, as it would improve your experience by the same margins. A gaming-specific keyboard might also help, as average keyboards can have 10-20ms of input lag before the keypress registers with the OS (Source: https://pavelfatin.com/typing-with-pleasure/ ) Realistically, though, I doubt many people could A/B test the difference between a 1ms and a 30ms latency editor under ideal conditions, let alone while typing out some code.

Re:Typometer: A tool to measure and analyze the visual laten... by kirse on Saturday July 25, 2020 @09:01PM (#23953606)
If you really believe that you're sensitive enough

It's pretty obvious when using extended shortcuts or a string of keys that are committed to muscle memory, like Ctrl+Shift+P (+ first letter of a cmd) or Ctrl+K combos.

Imagine playing an instrument wired up to headphones and then adding a 30-60 ms delay... the longer the delay the more it creates that "off" feeling

Don't forget too, those are bare metal calculations. Stick those apps inside a VM like many devs do or add some other latency along the I/O chain and it all helps to create a perception of lag.

Re:Typometer: A tool to measure and analyze the visual laten... by PragmaticPulp on Saturday July 25, 2020 @09:11PM (#23953652)
> Imagine playing an instrument wired up to headphones and then adding a 30ms delay

We need to keep these numbers in context. 30ms delay would appear as an echo if you were playing an instrument and also listening to a 30ms delayed version of the same sound.

However, you're not feeling the latency. You're noticing the presence of two distinct signals. That's why UX input latency matters much more when you're doing something like dragging across the screen with your finger on the screen: You visually register the distance between your finger and the expected location.

However, when you're typing a memorized series of letters on a keyboard, you're not comparing the keypresses to the letters appearing on the screen. You already know what you're typing and what you expect to see on the screen. Visual stimulus latency is on the order of 250ms, so you wouldn't even begin to start processing types for an order of magnitude larger than the latency of these text editors, for example.

Most of us are operating with regular 60Hz laptops or monitors. End-to-end latency from physical key press to physical color change on your monitor might be as high as 50-60ms even with zero-latency software.

Re:Typometer: A tool to measure and analyze the visual laten... by jcelerier on Sunday July 26, 2020 @04:05AM (#23955322)
> However, when you're typing a memorized series of letters on a keyboard, you're not comparing the keypresses to the letters appearing on the screen. You already know what you're typing and what you expect to see on the screen. Visual stimulus latency is on the order of 250ms, so you wouldn't even begin to start processing types for an order of magnitude larger than the latency of these text editors, for example.

nothing makes me want to throw my computer through the window faster than typing and not having an instant response honestly. It doesn't matter that the brain cannot process the letter. Would you imagine handwriting where the shape of the letters you write is 1/4th of letter shape late ?

Even for typing, just comparing xterm at 60hz and 120hz on my monitor feels different when typing moderately fast (100 wpm according to https://typing-speed-test.aoeu.eu/?lang=en)

Re:Typometer: A tool to measure and analyze the visual laten... by suyjuris on Sunday July 26, 2020 @05:05AM (#23955583)
> However, you're not feeling the latency. You're noticing the presence of two distinct signals.

Not necessarily; it could be an electronic instrument.

I once tested a "e-piano -> midi -> PC -> headphones" chain. The latency was not really noticeable when I pressed only a single key, but actually playing was impossible. After I replaced a (software) component with something with lower latency, it was bearable. While I cannot precisely estimate the latency reduction, I would guess that it was less than 30ms.

Re:Typometer: A tool to measure and analyze the visual laten... by drewnoakes on Saturday July 25, 2020 @11:39PM (#23954238)
The ear's whole function is to detect differences in patterns. This is how we identify the direction of sound with only two ears. For our ears, a delay of 30ms is an eternity.

The eyes on the other hand have very little response to this. Some will say they can spot a 15ms vs 30ms visual delay easily, but this is an open debate rather than an obvious fact. A 15ms delay in audio is noticeable to almost anyone.

Different senses, different sensitivities. Comparing them isn't very instructive.

Re:Typometer: A tool to measure and analyze the visual laten... by setzer22 on Sunday July 26, 2020 @03:42AM (#23955209)
Your 15/30ms is close to the timings of 30 vs a 60fps videogames. While testing for a single frame you'd probably get very mixed results, most people can distinguish the pattern of when the framerate drops from one to the other. That looks more close to me to the audio example, since it's a constant stream of visual information.
Re:Typometer: A tool to measure and analyze the visual laten... by CapsAdmin on Sunday July 26, 2020 @08:59AM (#23956751)
I think this is actually more to do with timing than audio.

I've made a jumping mechanism for a game that makes you move faster if you jump right when you hit the ground again. This system does not give any audible cues as to when you should jump. When something in this system is slightly off, ie keyboard latency, jump height, gravity, etc. You can't time the jumps properly and you're left feeling that you somehow just can't do it but can't really pinpoint what the problem is exactly.

I think the same applies to many games. Especially fighting games.

With that said, I don't think writing code is about timing. I think it's nice when an editor feels very responsive, but I don't think it necessarily makes me more productive.

Re:Typometer: A tool to measure and analyze the visual laten... by haecceity on Sunday July 26, 2020 @05:34AM (#23955714)
That might be slow because of autocomplete list starting and not because of rendering.
Re:Typometer: A tool to measure and analyze the visual laten... by squid_demon on Sunday July 26, 2020 @12:08AM (#23954363)
I don't agree with this at all. If the software doesn't care to make keypresses responsive how does this philosophy translate to anything more complicated than reading and rendering the result of these keystrokes? The answer is pretty obvious if you try any of the slower editors pointed out in the article (or pretty much 90% of software written in the last decade). It doesn't take a person with sensory hypersensitivity to pick up on the differences.
Re:Typometer: A tool to measure and analyze the visual laten... by sesuximo on Sunday July 26, 2020 @12:26AM (#23954435)
Maybe their philosophy was to focus on the large latency tasks and not the keystrokes
Re:Typometer: A tool to measure and analyze the visual laten... by RcouF1uZ4gsC on Saturday July 25, 2020 @08:42PM (#23953505)
>The difference between Sublime Text responding in 11.4ms average and Atom responding in 28.4ms average is difference of almost exactly 1 frame of latency for a typical 60Hz monitor

That is looking at the average latency for Atom. If you look at the max latency Atom, it is 60ms compared to 15 ms for Sublime text. That is basically 3 frames of latency difference on a 60Hz monitor, and would definitely be notable for the average person.

Re:Typometer: A tool to measure and analyze the visual laten... by PragmaticPulp on Saturday July 25, 2020 @08:47PM (#23953529)
> That is basically 3 frames of latency difference on a 60Hz monitor, and would definitely be notable for the average person.

Having done some UX work in this area, I can say that people greatly overestimate the effects of latency on text entry when they're just looking at the numbers. End-to-end lag is more obvious in situations like dragging objects, but even then people manage to work around it.

Typing isn't performed on a tight feedback loop in the brain. We don't wait for the letter to appear on screen before starting the process to press the next key.

Typical human reaction types are on the order of 250ms for a simple visual stimulus. Recognizing letters will take even longer. A difference of a few 10s of milliseconds isn't generally going to be noticeable for typing unless you're really going to great lengths to A/B test.

Consider that people can SSH into remote machines all of the time with 100s of milliseconds of latency. The experience may not be optimal, but our typing doesn't fall apart over SSH.

Re:Typometer: A tool to measure and analyze the visual laten... by numpad0 on Saturday July 25, 2020 @11:29PM (#23954202)
People tends to compare latencies of devices to human cognition-action loop and declare it irrelevant, but paraphrasing what I’ve heard from a gamer, their understanding is their ability to eyeball sub-10ms range latencies comes from a fact that their I/O loop runs synchronously to real time by training, that added latency can disrupt and force re-adjustments in detectable ways. Like 1PPS signals can be used to sync time in orders of picoseconds, precision of an event is not limited by frequency, only by deviations. Isn’t that interesting?
Re:Typometer: A tool to measure and analyze the visual laten... by toast0 on Saturday July 25, 2020 @10:47PM (#23954008)
I think the latency becomes most problematic when it's inconsistent, and if you want to fix input errors, or move the cursor and then input something.

I've experimented with video games with various amounts of display lag or dropped frames; nothing blinded or anything (although, setting up a blind test sounds fun), and there's clearly an increase in difficulty the farther you get between input and response. Writing code is clearly not Mario Brothers, but small delays can add up.

Re:Typometer: A tool to measure and analyze the visual laten... by magicalhippo on Saturday July 25, 2020 @11:36PM (#23954226)
> I think the latency becomes most problematic when it's inconsistent

Indeed! I don't have a problem using say a SSH console with 1 second lag. After a bit of initial cursing, it works just fine, I can write my code or edit conf files just fine. It's not as comfortable as writing at home, but it's not really a big deal.

However if the lag is inconsistent, say due to packet drops, it's horrible. Even if the base latency is low.

Re:Typometer: A tool to measure and analyze the visual laten... by codinger on Sunday July 26, 2020 @02:34AM (#23954956)
It's funny you mention this, because I like to use vscode over ssh. I believe the editor updates the screen before the change is ever made on the server, so it feels nice and responsive like you're coding on your home machine.
Re:Typometer: A tool to measure and analyze the visual laten... by setzer22 on Sunday July 26, 2020 @03:49AM (#23955252)
Not trying to take merit away from VSCode, but emacs and tramp mode also do that. And not just with remote machines over ssh, docker containers work as well. Also docker containers over an ssh connection (or whatever crazy combination you may need).

You get latency-free editing because the file is edited locally and sent to the server on save. Simple implementation but highly effective.

Re:Typometer: A tool to measure and analyze the visual laten... by mrob on Sunday July 26, 2020 @05:54AM (#23955816)
I use 60Hz keyboard autorepeat for navigation, so latency is very noticeable. I need prompt visual feedback to tell me if my estimate of the autorepeat startup delay is too short or too long. The quicker I get it the shorter the navigation sequence I can make while still having a good chance of hitting the correct frame-perfect key-release timing. Note that reaction time is irrelevant; I anticipate everything and only use the visual feedback for timing adjustment ("rushing or dragging" in drumming terminology).
Re:Typometer: A tool to measure and analyze the visual laten... by gsich on Saturday July 25, 2020 @08:52PM (#23953557)
>Your monitor likely has some input processing as well, adding anywhere from 10-20ms before it sends the frame to the physical display.

This is more in the 1-2ms range, even for non-gaming devices.

Re:Typometer: A tool to measure and analyze the visual laten... by PragmaticPulp on Saturday July 25, 2020 @08:59PM (#23953593)
Good G-Sync or FreeSync gaming monitors can get down to low single digit millisecond numbers, but the typical 60Hz non-gaming monitor or laptop display will be more in the 8ms-15ms range.

Example: https://www.rtings.com/monitor/tests/inputs/input-lag (Scroll down to the non-gaming monitors)

The gray-to-gray response time for the physical pixels is in the neighborhood of 2-4ms, so the additional latency comes from the processing.

Re:Typometer: A tool to measure and analyze the visual laten... by gsich on Sunday July 26, 2020 @12:21AM (#23954413)
That's not input processing.

Example of a 9 year old "office" monitor: https://www.prad.de/testberichte/test-monitor-dell-u2412m/6/...

Re:Typometer: A tool to measure and analyze the visual laten... by stinos on Sunday July 26, 2020 @09:10AM (#23956806)
Also most LCD monitors do not update all pixels at once. So the topleft pixels effectively change about a frame earlier than the ones at the borrom right. Which puts some of the numbers there also into perspective.