TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Terminal Latency (2017)

66 pointsby merwanedralmost 3 years ago

11 comments

modelessalmost 3 years ago
The bad news is the defaults on modern platforms are often very bad for latency. The good news is that it is possible to achieve good latency on most modern systems with a lot of attention to detail. With good hardware and good software it is even possible to e.g. run console emulators with lower latency than they would have on original hardware connected to a CRT. I just wrote a three part series detailing a lot of ways to improve latency:<p>Intro: <a href="https:&#x2F;&#x2F;james.darpinian.com&#x2F;blog&#x2F;latency" rel="nofollow">https:&#x2F;&#x2F;james.darpinian.com&#x2F;blog&#x2F;latency</a><p>Techniques to improve latency in your applications: <a href="https:&#x2F;&#x2F;james.darpinian.com&#x2F;blog&#x2F;latency-techniques" rel="nofollow">https:&#x2F;&#x2F;james.darpinian.com&#x2F;blog&#x2F;latency-techniques</a><p>Platform-specific considerations: <a href="https:&#x2F;&#x2F;james.darpinian.com&#x2F;blog&#x2F;latency-platform-considerations" rel="nofollow">https:&#x2F;&#x2F;james.darpinian.com&#x2F;blog&#x2F;latency-platform-considerat...</a>
评论 #32433495 未加载
adrusialmost 3 years ago
<p><pre><code> ~2 msec (mouse) 8 msec (average time we wait for the input to be processed by the game) 16.6 (game simulation) 16.6 (rendering code) 16.6 (GPU is rendering the previous frame, current frame is cached) 16.6 (GPU rendering) 8 (average for missing the vsync) 16.6 (frame caching inside of the display) 16.6 (redrawing the frame) 5 (pixel switching) </code></pre> I&#x27;m not very familiar with graphics pipelines, but some stuff here seems wrong. If a game is rendering at 60fps, the <i>combined</i> compute time for simulation+rendering should be 16.6 ms. You can&#x27;t start simulating the next tick while rendering the previous tick unless you try to do some kind of copy-on-write memory management for the entire game state. And with double buffering, the GPU should be writing frame <i>n</i> to the display cable at the same time as it&#x27;s computing frame <i>n+1</i>., and the display writing the frame to its cache buffer should be happening at the same time as the GPU writes the frame to the cable.<p>By my count that&#x27;s a whole 50 ms that shouldn&#x27;t be there.<p>From the linked article:<p><i>One thread is calculating the physics and logic for frame N while another thread is generating rendering commands based on the simulation results of frame N-1.</i><p>Maybe modern games <i>do</i> use CoW memory?<p><i>[The GPU] might collect all drawing commands for the whole frame and not start to render anything until all commands are present.</i><p>It <i>might</i>, but is this typical behavior? This implies that the GPU would just sit idle if it finished rendering a frame before the CPU finished sending commands to draw the next one — why would it do that?<p><i>Most monitors wait until a new frame was completely transferred before they start to display it adding another frame of latency.</i><p>Maybe this is what is meant by the &quot;16.6 (frame caching inside of the display)&quot; item? That might be real then.
评论 #32420873 未加载
评论 #32423228 未加载
评论 #32421752 未加载
评论 #32429433 未加载
评论 #32421074 未加载
评论 #32420916 未加载
评论 #32420681 未加载
dwheeleralmost 3 years ago
Related: &quot;Why Modern Computers Struggle to Match the Input Latency of an Apple IIe&quot; <a href="https:&#x2F;&#x2F;www.extremetech.com&#x2F;computing&#x2F;261148-modern-computers-struggle-match-input-latency-apple-iie" rel="nofollow">https:&#x2F;&#x2F;www.extremetech.com&#x2F;computing&#x2F;261148-modern-computer...</a><p>The Apple &#x2F;&#x2F;e, with its 1MHz clock and 8-bit CPU, had an average latency from keypress to character display of 30msec. Modern computers are dramatically slower in keypress to text display. There are reasons, but end users see a slower system.
评论 #32423013 未加载
dangalmost 3 years ago
Related:<p><i>Terminal latency (2017)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=19443076" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=19443076</a> - March 2019 (109 comments)<p><i>Terminal and shell performance</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14798211" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14798211</a> - July 2017 (204 comments)
terminallyboredalmost 3 years ago
The zutty project had an interesting article on terminal latency, as well:<p><a href="https:&#x2F;&#x2F;tomscii.sig7.se&#x2F;2021&#x2F;01&#x2F;Typing-latency-of-Zutty" rel="nofollow">https:&#x2F;&#x2F;tomscii.sig7.se&#x2F;2021&#x2F;01&#x2F;Typing-latency-of-Zutty</a>
tingletechalmost 3 years ago
I learned vi over dial up in the early 90s. One&#x27;s fingers would often be very far ahead of the screen.
评论 #32420906 未加载
评论 #32420686 未加载
leephillipsalmost 3 years ago
Maybe of more interest would be <a href="https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;751763&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;751763&#x2F;</a>, which measures latency on Linux.
kgwxdalmost 3 years ago
Not a big deal, 122.6 ms is still way below the Doherty Threshold :)<p>Dropping into a real terminal on Linux feels so weird when typing. I swear sometimes I see a letter on the screen before I actually touch the key. Similar to playing an Atari on a CRT, paddle games, like Breakout, feel like you&#x27;re physically attached to the on-screen paddle with a sturdy rod as opposed to the mushy feel you get from a mouse in modern games.
bitwizealmost 3 years ago
Curiously not listed: xterm, which has close to the lowest latency of any open source TE. But who uses that anymore?
评论 #32424802 未加载
评论 #32421149 未加载
评论 #32420909 未加载
评论 #32424200 未加载
aurelienalmost 3 years ago
why not xterm? xterm respect most of standard, maybe one of the closest to all standards.
collegeburneralmost 3 years ago
semi related but anybody know how i fix the powershell latency on windows? it&#x27;s literally unusable as a shell besides running scripts.
评论 #32420727 未加载