<story><title>iTerm2 has a new drawing engine that uses Metal 2</title><url>https://gitlab.com/gnachman/iterm2/wikis/Metal-Renderer</url></story><parent_chain><item><author>evmar</author><text>I fiddle in this area as a hobby project.  One thing I never understand when I read announcements like this is why the graphics performance affects the throughput.  Like in a video game, the world moves at the same rate regardless of the frame rate, so why are the two related here?&lt;p&gt;In some of my experimental terminal emulators I&amp;#x27;ve decoupled these and it&amp;#x27;s not so hard -- there&amp;#x27;s a piece that processes command output as fast as it can, and then there&amp;#x27;s another piece that updates the screen as fast as it can, and as long as those two pieces are decoupled then even if your graphics hardware is 5fps it&amp;#x27;s still fast to cat a file.</text></item></parent_chain><comment><author>gnachman</author><text>It&amp;#x27;s a funny feeling opening hacker news and seeing your project at the top :)&lt;p&gt;In iTerm2&amp;#x27;s case it&amp;#x27;s because of bad decisions about a decade ago. The data model is read &amp;amp; written on the main thread. The main thread is solely responsible for drawing operations if you use the standard drawRect: interface on NSView. That means that a slow draw blocks it from processing more data. Other work, like reading from the socket and parsing bytes into tokens was offloaded onto other threads years ago. Unwinding all the assumptions about single-threadedness is nearly impossible. The only way to reduce the main thread&amp;#x27;s workload is to use a GPU renderer because building the data structures the GPU needs can be done off the main thread after a quick copy of the necessary state.</text></comment>
<story><title>iTerm2 has a new drawing engine that uses Metal 2</title><url>https://gitlab.com/gnachman/iterm2/wikis/Metal-Renderer</url></story><parent_chain><item><author>evmar</author><text>I fiddle in this area as a hobby project.  One thing I never understand when I read announcements like this is why the graphics performance affects the throughput.  Like in a video game, the world moves at the same rate regardless of the frame rate, so why are the two related here?&lt;p&gt;In some of my experimental terminal emulators I&amp;#x27;ve decoupled these and it&amp;#x27;s not so hard -- there&amp;#x27;s a piece that processes command output as fast as it can, and then there&amp;#x27;s another piece that updates the screen as fast as it can, and as long as those two pieces are decoupled then even if your graphics hardware is 5fps it&amp;#x27;s still fast to cat a file.</text></item></parent_chain><comment><author>tomc1985</author><text>Unless the programmer specifically decouples graphics from the rest of the program, anything that renders to the screen will have to wait for that command to finish drawing. It will effectively govern the throughput of any program that both prints lots of text to screen and is not appropriately multithreaded.</text></comment>