News for hackers. Stuff that matters.
Re:Typometer: A tool to measure and analyze the visual laten... by userbinator on Saturday July 25, 2020 @07:57PM (#23953291)
The companion article at https://pavelfatin.com/typing-with-pleasure/ has some example results, showing Atom, the only Electron-based one in the list, as having several times more latency than the others. I wonder how VSCode compares.

It's unfortunate that software seems to feel slower the newer it is, including developer tools such as text editors/IDEs. I suspect this is because most people - including younger developers - have never seen how fast things can be, but are instead constantly subjected to delays in using applications to the extent that they think it is an absolutely normal speed[1], and then propagate that notion to the software they themselves create.

Also related: https://danluu.com/input-lag/

[1] For example, everything that uses UWP in Windows. Someone who had only ever used the Settings app in Windows 10, or (even worse) the Calculator, might not realise how absurdly slow they are in comparison to the previous versions' where they would open nearly instantaneously.

Re:Typometer: A tool to measure and analyze the visual laten... by senkora on Saturday July 25, 2020 @08:52PM (#23953562)
A few months ago I found my old GameBoy and played through part of "Kirby: Nightmare in Dreamland". I know its not the most well-known game, so the relevant detail is that it relies a lot on timing and quick movements.

I was completely blown away by the responsiveness of the controls. The control feedback was instant, frames were rock-solid, and there were no loading screens at all.

When I put down the game, I was just tremendously sad. I'd forgotten what instant feedback felt like.

Re:Typometer: A tool to measure and analyze the visual laten... by agumonkey on Sunday July 26, 2020 @03:58AM (#23955289)
I think it says something about human interfaces. When I run old linux 2.4 distros, even if everything is crude (GUIs redraw without double buffering, no compositor nothing).. no font AA .. yet it feels 'better'. And it's not nostalgia only.
Re:Typometer: A tool to measure and analyze the visual laten... by dahfizz on Saturday July 25, 2020 @11:03PM (#23954082)
It really amazing playing with old technology. In Super Mario Bros on the NES, when you press the jump button Mario jumps the very next frame. And with a CRT you get instant response time.

You just can't get that responsiveness anymore.

Re:Typometer: A tool to measure and analyze the visual laten... by cjsawyer on Sunday July 26, 2020 @12:06AM (#23954359)
How does that compare to 144hz 1ms response gaming monitors? I know that late CRT’s handily beat early flatscreens but does that still hold?
Re:Typometer: A tool to measure and analyze the visual laten... by fxtentacle on Sunday July 26, 2020 @05:30AM (#23955697)
For a PC, you'll most likely have USB latency, double-buffering, latency between the graphics card and the screen, latency due to picture processing in the screen. All that is additional to the 1ms that the pixels need to switch color after the instruction to do so has been received.
Re:Typometer: A tool to measure and analyze the visual laten... by correct_horse on Sunday July 26, 2020 @06:25AM (#23955981)
In addition to these excellent points, the "1 ms" pixel response time is measured grey to grey i.e. favourable to the display and not real-world. The bigger problem with advertised pixel response times is there is no industry standard measurement procedure (which grey to which grey?, is hdmi processing latency counted?), so pixel response times are vague, mostly useless marketing.
Re:Typometer: A tool to measure and analyze the visual laten... by Ijumfs on Sunday July 26, 2020 @12:53AM (#23954533)
You don't have to believe these claims you know. And you need to add up all the latencies of all the components in the chain, from your keyboard and mouse to DirectX or whatever it is...
Re:Typometer: A tool to measure and analyze the visual laten... by yjftsjthsd-h on Saturday July 25, 2020 @11:59PM (#23954327)
Wait, why would a CRT be faster than LCD? If anything, I'd naively expect faster response with no electron beam to move.
Re:Typometer: A tool to measure and analyze the visual laten... by nwallin on Sunday July 26, 2020 @01:16AM (#23954613)
It's not so much that CRTs are faster than LCD.

It's that old consoles (up until the Sega Saturn, Nintendo 64, Sony Playstation era) didn't draw to frame buffers. They didn't have enough RAM to have a real frame buffer.

You configured the graphics chip what you wanted it to draw, and as the scanline scanned across the screen, it outputted the color that was supposed to be output depending on the background/sprite/palette settings. You could change where the sprite is halfway across the scanline, and it might immediately, in the middle of drawing a scanline, output a different color. There was no delays anywhere in the system, only the propagation delay of electricity in wires and transistors. The various HW registers that controlled what and where the sprites were were connected via a small pile of non-clocked digital logic gates to a DAC to the analog output pins of the graphics chip, which was connected to the electron guns directly if you used component video or via a simple, no-latency analog circuit if you had composite video.

These days, you program the graphics card to draw what you want it to draw. Once you've programmed everything for it to draw, it draws that into the backbuffer. Once the current frame has been sent to the display, the backbuffer is swapped with the frontbuffer. When the next frame begin is sent to the display, your changes finally go out across the wire. Depending on the display (see especially motion adapting TV screens) there might be more delay. Then whatever changes you make are finally displayed on the screen.

It's kinda weird. Old video game consoles (up until the SNES and Genesis) had extremely low latency. And that's been gone for 25 years. Not only is it gone, but it will likely be gone forever- we don't even make the technology anymore to show the new generation what it was like. On the one hand, the new technology is "better"; there's no way to do today's advanced graphics without a deep drawing pipeline that outputs to a frame buffer. But it's also somehow worse. We can make it less bad with technology like 144Hz and Freesync, but the old era is gone.

Re:Typometer: A tool to measure and analyze the visual laten... by minerjoe on Sunday July 26, 2020 @03:40AM (#23955203)
Thank you for this.

I started on the Apple II and i'ts been downhill since then. If I remember correctly the Apple II has one of the smallest latency between touching a key and seeing the result on the screen.

Re:Typometer: A tool to measure and analyze the visual laten... by lukevp on Sunday July 26, 2020 @01:57PM (#23958826)
While this is true of LCDs, OLEDs have basically no draw latency, so conceivably they could directly update as the frame buffer was populating like a CRT if the gpu driver and OLED driver allowed it. This would still have tearing though for a modern game, so it is likely that it would need to buffer and draw entire frames at a time, which could still give you only 1 frame of latency. Most of the older games were not updating the positional information of sprites between frames (just using scanlines for raster effects) so there was already 1 frame of latency on input updates.
Re:Typometer: A tool to measure and analyze the visual laten... by ponker on Sunday July 26, 2020 @06:29AM (#23955997)
Does n64 have a frame buffer?
Re:Typometer: A tool to measure and analyze the visual laten... by nwallin on Sunday July 26, 2020 @08:31PM (#23961250)
Yes.

The N64 had a unified memory architecture, so the frame buffer was just a region of memory within the unified system RAM that was drawn to. The Z buffer was the same way. (assuming the programmer chose to enable to the Z buffer) It was still a frame buffer though.

Re:Typometer: A tool to measure and analyze the visual laten... by formerly_proven on Sunday July 26, 2020 @08:01AM (#23956436)
The scan speed is exactly the same for all screens when driven by the same timings (resolution, blanking, refresh rate), so there is no difference there. Most digital screens have some processing lag, for gaming screens usually 1-4 ms. This doesn't exist in a CRT. LC panels have a pixel response time, somewhere around 1-40 ms depending on the color change, drive mode and panel type ("1 ms" is always a grey-to-grey transition and generally with overdrive). CRT phosphor lights up practically instantly when hit by the electron beam.

So for a given set of timings, you'd always expect the CRT to be faster, because it represents the absolute minimum time-of-flight delay, assuming it is driven by a direct RAMDAC and not by a conversion box buffering an entire frame or significant portions.

Also, you can "move" electron beams at extremely high speeds. Even in a magnetic deflection CRT like the GDM-FW900 the electron beam can move at more than 80 km/s[1]. In some electrostatic deflection systems the speed of light is exceeded: they can draw a dot moving across the face of the CRT that moves at a higher speed than c. This is possible because "the beam" is a fictional object.

[1] 2304 dots across 482 mm with a pixel clock of around 384 MHz means these 2304 dots are covered in about 6 µs; 482 mm/6 µs = 80.3 km/s.

Re:Typometer: A tool to measure and analyze the visual laten... by bloaf on Sunday July 26, 2020 @12:20AM (#23954412)
For an interesting discussion:

https://www.reddit.com/r/smashbros/wiki/lag

Re:Typometer: A tool to measure and analyze the visual laten... by Kuinox on Sunday July 26, 2020 @05:52AM (#23955808)
CRT have latency in the nanosecond. Best LCD screen says they have 1ms latency.
Re:Typometer: A tool to measure and analyze the visual laten... by ce4 on Sunday July 26, 2020 @12:06AM (#23954356)
The NES-CRT connection is analog and the screen is drawn line by line, if you connect a digital monitor that will have to be buffered and you get some delay/lag of min 1 frame.
Re:Typometer: A tool to measure and analyze the visual laten... by mrob on Sunday July 26, 2020 @05:35AM (#23955716)
Most LCDs only buffer a single line at a time:

https://www.youtube.com/watch?v=wts8f1bNnbo

Re:Typometer: A tool to measure and analyze the visual laten... by formerly_proven on Sunday July 26, 2020 @08:18AM (#23956547)
You misunderstand the video. A LCD controller must buffer at least one line, because the LCD matrix is updated line for line, all columns in parallel -- it's a matrix, much like a RAM matrix. However, the video just shows how the LCD is scanned out, it doesn't say anything about the buffering of the controller. A lot of non-gaming LCDs, and virtually all older non-gaming LCDs, buffer an entire frame, even if they are driven in their native mode.
Re:Typometer: A tool to measure and analyze the visual laten... by contravariant on Saturday July 25, 2020 @08:28PM (#23953439)
I also can't be the only one annoyed by the input lag in the windows login screen and start menu search. Somehow both of them seem to think it's fine to just ignore keypresses for half a second before doing anything.

Annoyance aside I seriously worry about the accessibility of the windows lock screen. Through a weird display setup I sometimes find myself trying to log in blind and I just can't do it. There seems to be no way to reliably focus the password field, and for whatever insane reason it's not just always in focus

Re:Typometer: A tool to measure and analyze the visual laten... by modeless on Sunday July 26, 2020 @03:09AM (#23955074)
This insanity is apparently intentional, but can be fixed for the lock screen at least: Win+R->gpedit.msc->"Computer Configuration"->"Administrative Templates"->"Control Panel"->"Personalization"->"Do not display the lock screen"->Enabled

This poorly named option doesn't disable locking the screen, it just fixes it to not eat your first few keystrokes when you start typing your password.

Re:Typometer: A tool to measure and analyze the visual laten... by throw_away on Sunday July 26, 2020 @09:20AM (#23956868)
This is one of the reasons why Windows drives me bonkers— all the interesting settings seem to be locked in disused basement lavatories. See also changing capslock to control.
Re:Typometer: A tool to measure and analyze the visual laten... by TeMPOraL on Sunday July 26, 2020 @03:26PM (#23959477)
> See also changing capslock to control.

Is it even possible to do it through system settings alone, even if obscure ones? I use AutoHotkey to do Caps Lock -> Ctrl remap, and it's one of the first programs I install on every new system.

Re:Typometer: A tool to measure and analyze the visual laten... by throw_away on Monday July 27, 2020 @10:36AM (#23965456)
My windows experience is as infrequent and as brief as I have been able to make it, but AFAIK editing registry keys + reboot is the only way to do it without third-party software.

Thanks for the AHK tip. The programs I usually find look like hastily-constructed malware on a dodgy sourceforge link & always make me feel real :-| about installing them on a fresh box.

Re:Typometer: A tool to measure and analyze the visual laten... by kohtatsu on Monday July 27, 2020 @11:12AM (#23965849)
Happy 10th HN anniversary!
Re:Typometer: A tool to measure and analyze the visual laten... by TeMPOraL on Monday July 27, 2020 @01:13PM (#23967132)
Thank you!

Wow, how the time flies!

Re:Typometer: A tool to measure and analyze the visual laten... by ponker on Sunday July 26, 2020 @01:13PM (#23958483)
Don’t think this is available on Windows 10 Home.
Re:Typometer: A tool to measure and analyze the visual laten... by modeless on Sunday July 26, 2020 @04:00PM (#23959724)
It might be possible to toggle this on Home using regedit if you can find the registry key that this UI controls.
Re:Typometer: A tool to measure and analyze the visual laten... by wyattpeak on Saturday July 25, 2020 @11:51PM (#23954300)
The login screen one is particularly ridiculous, because my Ubuntu machine takes about as long to wake up as my Windows, but it sensibly buffers the keypresses until it can insert them so I never mistype.

It's just glaringly obvious that nobody has bothered for even a second to think about how to solve the problem (or indeed, just copied the solution that already exists elsewhere).

The start menu on the other hand I gave up on several years ago. I don't know what's in it anymore, and I don't care, because nothing could be worth the >5s wait for it to open.

Re:Typometer: A tool to measure and analyze the visual laten... by rkagerer on Saturday July 25, 2020 @11:26PM (#23954192)
...windows login screen and start menu search

I don't use them.

I use Open-Shell (formerly Classic Shell). Before that I used Launchy (which is another crazy-fast alternative) tied to my CapsLock key.

I've also had tabs on my file Explorer windows, since Win 7 (thanks to QTTabBars). I'm commonly asked about that after I give remote desktop presentations.

Re:Typometer: A tool to measure and analyze the visual laten... by mwcampbell on Saturday July 25, 2020 @09:29PM (#23953698)
> Annoyance aside I seriously worry about the accessibility of the windows lock screen. Through a weird display setup I sometimes find myself trying to log in blind and I just can't do it.

If you try running a screen reader, such as Narrator (built into Windows; edit: turn it on and off with Ctrl+Win+Enter, even on the logon screen), you should find that even if the focus somehow gets away from the Password field, you can get back there with the help of speech output. Logging in blind doesn't have to mean logging in with no means of orientation.

(Disclosure: I'm a developer at Microsoft on the Windows accessibility team, working on Narrator among other things.)

Re:Typometer: A tool to measure and analyze the visual laten... by contravariant on Saturday July 25, 2020 @10:21PM (#23953906)
Fair enough, but on a screen who's sole purpose is to let me type in my password I really shouldn't require a Narrator to find the one and only input field. It's nice that the problem has a solution, but it shouldn't have been a problem to begin with.
Re:Typometer: A tool to measure and analyze the visual laten... by mwcampbell on Saturday July 25, 2020 @10:43PM (#23953989)
The trouble is that this screen isn't just for entering your password. On my logon screen, I have not only the PIN field (because I enabled the TPM-based Windows Hello feature), but also these other links or buttons: "I forgot my PIN", "Sign-in options", network, Ease of Access, and power. So use of a full GUI framework, that supports accessibility tools such as a screen reader, is justified.
Re:Typometer: A tool to measure and analyze the visual laten... by 6510 on Sunday July 26, 2020 @12:19AM (#23954405)
The user doesn't care about any of that. I should be able to wake up the box by typing the pin. The reality is that i have to press the first letter of it then wait then press it again and then I have to wait and see if a dot appears in the field.

The reason it works like this is that the user is forced to use the software. It should be the other way around. If people are forced to use something developers should do what they can to not make the experience incredibly annoying.

Sure, there can be situations where you need to cut corners but this is the log in screen.

After logging in I mistype an application name in the search box and wait for the dialog to pop up that says "Best matches" with an empty list under it. It can't even find "tunderbird"

If I type a single letter it shows "search teh web for "a".

But it does show Atom! Woah! Technology at work!

I get to chose, I can press the down arrow and select "apps" then press enter twice OR I can press the down arrow twice and press enter! Becareful! Dont press the arrow to fast or it jumps back to searching the web for "a".

No one put any thought into this process.

Re:Typometer: A tool to measure and analyze the visual laten... by mwcampbell on Sunday July 26, 2020 @07:44AM (#23956343)
> No one put any thought into this process.

You're making an uncharitable assumption about real people who work full-time on this stuff. I can assure you that they do put a lot of thought into their work. No, I never worked on the Start menu or search myself, but before we started working from home, I was in the same building with the folks that do.

Re:Typometer: A tool to measure and analyze the visual laten... by formerly_proven on Saturday July 25, 2020 @11:05PM (#23954100)
It always seemed to me like they intentionally made it so to specifically hinder people from logging in blindly or unlocking blindly; I always assumed to avoid people accidentally typing their login password into an IM app if the machine wasn't actually locked.
Re:Typometer: A tool to measure and analyze the visual laten... by userbinator on Saturday July 25, 2020 @10:25PM (#23953926)
I wonder if the new login screen uses UWP; the appearance and speed (or lack thereof) also suggests so.

(The older versions of Windows had a native dialog box: http://www.guidebookgallery.org/pics/gui/startupshutdown/log... )

Re:Typometer: A tool to measure and analyze the visual laten... by mwcampbell on Saturday July 25, 2020 @10:49PM (#23954013)
The Windows 10 login screen definitely uses the UWP XAML framework. And no, I'm not revealing any inside knowledge; I knew this fact before I joined Microsoft (because I used to develop a third-party screen reader for Windows).
Re:Typometer: A tool to measure and analyze the visual laten... by jbay808 on Saturday July 25, 2020 @10:01PM (#23953835)
Agreed. The input lag often causes me to mistype my password as I double-type the first three characters, thinking that they didn't register the first time.
Re:Typometer: A tool to measure and analyze the visual laten... by tkzed49 on Saturday July 25, 2020 @08:10PM (#23953356)
I actually don't think that developers who use things like VSCode are simply naive. Personally, I am a young person and I frequently do use vim in a low-latency terminal emulator (xterm, mlterm) without a compositor. Yes, I enjoy the fact that it is very fast. However, I still use VSCode when I'm making more complicated edits primarily because of the plugin ecosystem. Plugins "just work", are easy to configure, and all work together nicely. I get rich syntax highlighting and intellisense. I might be doing something wrong, but this was not the experience I have had with vim.

I like the UI simplicity of VSCode in contrast to native editors such as IntelliJ and Visual Studio, which I do use when I really need the features. I am interested in efforts like Onivim 2, which seek to combine these advantages.

Re:Typometer: A tool to measure and analyze the visual laten... by denosawr on Saturday July 25, 2020 @10:33PM (#23953957)
You might be interested in coc.nvim, which can allow vim to use the LSP servers which powers VSC's intellisense. It's a bit of setup, but I've found with coc.nvim and a good syntax highlighting plugin, I can get a really great syntax highlighting and intellisense setup going.
Re:Typometer: A tool to measure and analyze the visual laten... by Shared404 on Saturday July 25, 2020 @08:45PM (#23953520)
Vim + Alacritty + Gruvbox = Happiness.

For me at least.

I've found that I get perfectly passable syntax highlighting with vim, and haven't needed anything else on my current install. If I did use an editor other than vim, I would probably use VSCodium because open build, and I do really like the visual style.

Re:Typometer: A tool to measure and analyze the visual laten... by twoleftfeets on Sunday July 26, 2020 @06:15AM (#23955927)
Agreed. I've been editing since the late 70s. At the moment I use VSCode the most. The plugins are the thing. They are doing things I've seen no other editor do. Of course I haven't used every editor.

The latest was I typed

    ...nameOfArrayInOtherFile
and it auto inserted

    import nameOfArrayInOtherFile from './tests/name-of-array-in-other-file.js';
a few lines above some how recognizing the pattern.

Another thing I've seen VSCode do is give me library specific warnings. Maybe that's common now-a-days in other editors but I hadn't seen it before. I'd seen language warnings but not library warnings.

Re:Typometer: A tool to measure and analyze the visual laten... by fxtentacle on Sunday July 26, 2020 @05:46AM (#23955781)
I would say the big outlier here are the JetBrains IDEs like IntelliJ, which have had zero-latency as their default configuration for 2 years now.

Also, it is worth noting, that the same person doing this research is the one working for JetBrains on optimizing editor latency: https://blog.jetbrains.com/clion/2017/01/clion-starts-2017-1...

So there are companies taking the editor latency issue seriously and that are close to fixing it.

Re:Typometer: A tool to measure and analyze the visual laten... by dsissitka on Saturday July 25, 2020 @10:45PM (#23954002)
> I wonder how VSCode compares.

I was curious so I did some tests:

https://imgur.com/a/73coWRR

Re:Typometer: A tool to measure and analyze the visual laten... by comfymatrix on Sunday July 26, 2020 @05:37AM (#23955729)
Thanks for this. I definitely wasn’t expecting VSCode to be almost on par with Emacs...
Re:Typometer: A tool to measure and analyze the visual laten... by dsissitka on Sunday July 26, 2020 @06:17AM (#23955939)
Hm, maybe I'm overlooking something but I'm not sure that it is? In my tests Visual Studio Code averaged 31.7 ms and Emacs averaged 4.8 ms.

It is on par with "the fastest terminal emulator in existence". :)

Re:Typometer: A tool to measure and analyze the visual laten... by Ballas on Monday July 27, 2020 @02:12AM (#23962614)
Your display pipeline has more latency than 31.7ms...
Re:Typometer: A tool to measure and analyze the visual laten... by lucb1e on Saturday July 25, 2020 @08:07PM (#23953337)
Direct link to the section with Windows results: https://pavelfatin.com/typing-with-pleasure/#windows

Scroll a bit down for Windows with power saving, Linux (section 3.4), and VirtualBox (3.5).

Re:Typometer: A tool to measure and analyze the visual laten... by hrktb on Sunday July 26, 2020 @04:45AM (#23955522)
Isn’t it because older tools never go away ?

Newer tools only come as alternatives to faster tools that continue to be usable at any time.

For instance I choose to use VSCode and consciously weight it down with plugins and extra linters, because the trade-off is fine for me.

But I know vim is only a click away, and if I wanted sheer speed I’d do it there. And I actually do use it on a day to day basis, it’s just not my primary editor.

Re:Typometer: A tool to measure and analyze the visual laten... by jhurliman on Saturday July 25, 2020 @08:10PM (#23953355)
The worst is when I see someone using vim or Emacs over SSH. If you think Electron apps are bad, imagine adding a network round trip between every keystroke!
Re:Typometer: A tool to measure and analyze the visual laten... by beering on Sunday July 26, 2020 @12:24AM (#23954431)
Suggestion for anyone who's annoyed by SSH latency - try out mosh[0]. It watches to see if your keystrokes are echoed and if they are, it'll start echoing your keystrokes locally without waiting for network roundtrip.

That, plus the ability to rejoin a session even from a different IP, makes working over SSH doable even from airplane Wi-Fi.

[0] https://mosh.org/

Re:Typometer: A tool to measure and analyze the visual laten... by vz8 on Saturday July 25, 2020 @08:27PM (#23953434)
Gui Emacs via tramp+ssh is awesome.

Terminal Emacs over ssh is, well, just like anything else in a terminal over ssh. Can't say I notice the latency unless the datacenter is on the other side of the country.

Re:Typometer: A tool to measure and analyze the visual laten... by cyberbanjo on Saturday July 25, 2020 @09:31PM (#23953706)
Isnt it the same if you use tramp in the terminal, assuming you are running emacs locally and tramping into the server to edit?
Re:Typometer: A tool to measure and analyze the visual laten... by sgillen on Saturday July 25, 2020 @11:48PM (#23954287)
Sure, although in that case why not use the GUI?
Re:Typometer: A tool to measure and analyze the visual laten... by ben0x539 on Saturday July 25, 2020 @08:27PM (#23953438)
idk, vim across ssh (rn from my place in the west coast to a vps in iirc the east coast) feels a lot snappier and less frustrating than my typical interaction with slack.
Re:Typometer: A tool to measure and analyze the visual laten... by sumedh on Sunday July 26, 2020 @08:24AM (#23956586)
You can use programs like winscp to open the file locally in your fav text editor and then upload back to the server when you click save.
Re:Typometer: A tool to measure and analyze the visual laten... by agumonkey on Sunday July 26, 2020 @03:56AM (#23955283)
I tried vscode on win10 core i5 1st gen. Could barely reach 2 keys per second. I was honestly shocked.
Re:Typometer: A tool to measure and analyze the visual laten... by noble_pleb on Saturday July 25, 2020 @08:13PM (#23953372)
Plus the new generation is pampered with much cheaper resources (RAM and CPU), so programming efficiency goes out of the window.