Skip to content
0:00 / 0:00

#refterm#windowsterminal#terminalemulator

[EPILEPSY WARNING] How fast should an unoptimized terminal run?

Molly Rocket

148K subscribers • 33 videos on Hallway

YouTube
  • Recommended by 7 people: 6 on Hacker News and 1 on Lobsters.
  • A classic. People kept recommending it from 2021 to 2025.
  • Presented by Casey Muratori, founder of Molly Rocket
  • Linked in the descriptioncmuratori/refterm
  • An opinion. It argues one side of a question engineers disagree on.

Intermediate. Assumes working knowledge.

192K views5 years ago7 recommendations

Systems programmingTools and practicePerformance and optimizationRenderingOperating systems

Casey Muratori demonstrates a simple, unoptimized terminal renderer that runs thousands of times faster than modern terminal emulators.

[EPILEPSY WARNING] At the end of this video, I demonstrate colored text on colored background tiles. The reference renderer displays this benchmark so quickly that the screen appears to flash colors violently. If you are photo-sensitive, you may want to stop watching the video before I run the colored text demo. [/EPILEPSY WARNING] Many modern terminals (like Windows Terminal, etc.) run extremely slowly - often hundreds or thousands of times slower than PC hardware allows. Yet for some reason, pointing this out leads to lots of strange excuses from developers, all of which are not true. In this video, I demonstrate how a very simple (~3000 line) codebase written in a few days - and literally never optimized at all - still runs by default at thousands of frames per second under real-world conditions, while supporting features that many modern terminals don't, like right-to-left strings of Arabic combining Unicode. The course mentioned in the video is Star Code Galaxy (starcodegalaxy.com). The code for this reference rasterizer is available under GPLv2 on GitHub (github.com/cmuratori/refterm)

Why it's here

7 people recommend this

What people say. Highly recommended as a masterclass in software performance and a critique of modern bloated software development.

mikejsavageon Lobsters • Recommends

How fast should an unoptimized terminal run?

dmitriidon Hacker News • Recommends

On “Apple and Intel first to use TSMC 3nm”

As luck would have it, here's the continuation to Windows Terminal. Casey Muratori made a reference terminal renderer: link This uses all the constraints that the Windows terminal team cited as excuses: it uses Windows subsystems etc. One person, 3k lines of code, it runs 100x the speed of Windows terminal. See the epic demo (and stay till the end for color output): link to this video

dundariouson Hacker News • Recommends

On “Windows Terminal Source Code”

Worth watching Casey Muratori's series of videos on terminals, and how to implement them, where he often makes specific comparison to Windows Terminal. He has some specific criticisms that are easy to disagree with, but the vast majority are well warranted. His broader series of videos on the topic are even worthwhile from a purely "software engineering education" standpoint. link to this video I feel a bit bad about posting comments about it relatively frequently on HN, but it's just so very very good, and snark aside, his perspective is extremely valuable.

dundariouson Hacker News • Recommends

On “Microsoft: Extremely slow performance when processing virtual terminal sequences”

With some limitations that I can’t remember, that I believe were minor and not insurmountable, Casey actually implemented a windows terminal with the “PhD” level work mentioned in this issue. He showcases it here. link to this video I watched it months ago, but from memory, I believe: - it has better Unicode/layout support than windows-terminal - it renders as fast as promised - it has a tiny code base

djoldmanon Hacker News • Recommends

On “When I tell the Windows Terminal team something is simple, I am "misguided"”

Link to dev's presentation of their implementation that seems to run circles around microsoft's terminal: link to this video

jiggawattson Hacker News • Recommends

On “Why modern software is slow”

…be pretty. Everyone needs it to work .2 Just amazing to see something like this happen. It's like a slow motion train wreck, ruining one Windows app at a time. 1 These videos are especially "shocking" because the code he wrote is terse, straightforward, lightning fast, and more correct than whatever madness Microsoft was doing. First weekend: link to this video Second weekend: link 2 For example, opening a 300 MB log file takes a solid minute of time, which is absurdly slow. It also bloats this to 800 MB of memory usage. For comparison, TextPad opens it in 5 seconds and uses 30 MB of memory. VS Code, an electron application(!) opens in under 2 seconds.…

surprisetalkon Hacker News • Recommends

On “Compressing Codebase Collocates”

Author here. It is very implausible :) After watching an inspiring video on terminal optimization 1, I started doing some napkin math on how fast my ex-employers' programs "should" run and how many resources they "should" take up. With my very small sample size (N=5), those numbers definitely hold. My big untested assumption is that most startups have even worse codebases than what I've experienced in my short tenure haha. I'd be curious what an "average" startup could achieve in 6 weeks. 1 link to this video

jiggawattson Hacker News • Recommends

On “Ask HN: What makes Windows 11 perform much worse than Windows XP?”

Casey Muratori has some great YouTube videos (a.k.a.: rants) about the end-user visible performance degradation over the last two decades despite computers becoming 10-100x faster by various metrics. E.g.: Visual Studio Rant link How fast should an unoptimized terminal run? link to this video The root cause is that Microsoft simply doesn't have performance as a priority. It's not a KPI for (almost) anyone, certainly nobody in the desktop teams. Upper management doesn't prioritize input latency over telemetry or advertising "features". It's that simple. There's no pressure, no rejection of slow code, no metrics, no pride in good engineering. If it barely functions, it's good enough to ship.1 Microso…

jodrellblankon Hacker News • Recommends

On “Fast”

It's well known, but this video1 is a proof of concept demonstration from 4 years ago, Casey Muratori called out Microsoft's new Windows Terminal for slow performance and people argued that it wasn't possible, practical, or maintainable to make a faster terminal and that his claims of "thousands of frames per second" were hyperbolic, and one person said it would be a "PHD level research project". In response, Casey spent <1 week making RefTerm, a skeleton proto-terminal with the same constraints Microsoft people had - using Windows APIs for things, using DirectDraw with GPU rendering, handling terminal escape codes, colours, blinking, custom fonts, missing font character fallback, line wra…

u/skeetoin r/C_Programming • Mentions

On “Looking for for resources to write a win32 terminal emulator”

Over just the past few months there was all this hubbub about building a high performance terminal emulator for Windows since Microsoft is unable to do so. Here's that series: * How fast should an unoptimized terminal run? * Refterm v2 - Resource usage, binary splat, glyph sizing, and more * Refterm Lecture Part 1 - Philosophies of Optimization * Refterm Lecture Part 2 - Slow Code Isolation * Refterm Lecture Part 3 - Minimal Buffer Processing * Refterm Lecture Part 4 - Glyph Hash Table * Refterm Lecture Part 5 - Parsing with SIMD Source: https://github.com/cmuratori/refterm

u/ThePi7onin r/C_Programming • Mentions

On “terminal graphics on windows”

You may want to take a look at this It goes in depths on why Windows's terminal output is so slow compared to Linux, and how to work around it.

dr_zoidbergon Hacker News • Mentions

On “Rich: A Python library for rich text and formatting in the terminal”

> Layers and layers of cruft which you can trace back to before the computing era. Even those layers and layers don't _have to_ slow things down. Check the refterm "debacle" (2 for the context, 0, 1 as Muratori's answer to it). It's just the way things are usually programmed doesn't care about performance and how fast things really can be. I sometimes wonder in we're not due for a massive round of optimization on a couple of the layers that we're used to using/depend on. 0 link to this video 1 link 2 link

cmaon Hacker News • Mentions

On “React Native for Windows is helping Settings improve more quickly”

It is very slow and does more draw calls than a modern video game, melting laptop batteries: link to this video Same guy from this video did a series of videos rewriting the renderer in a weekend or so and going hundreds or thousands of times faster, with more advanced unicode/ligature/language support.

starburston Hacker News • Mentions

On “When I tell the Windows Terminal team something is simple, I am "misguided"”

Sure but in this case it was grossly over-estimated compared to the under-estimated side. Casey did the implementation 1 to prove the point and also made explanatory videos 2 of it. 1 link 2 link to this video

buchooon Hacker News • Mentions

On “Software Disenchantment (2018)”

Parkinson's law in software is real. As Jon Blow often says, our computers are basically supercomputers that are astoundingly bogged down by bad software development practices. The computer I'm on is at the very least several dozen times more powerful than the one I had 20 years ago, yet a lot of functionally equivalent software probably runs at about the same speed, certainly not an order of magnitude faster let alone several dozen times faster despite not doing several times more. The problem is that a lot of software developers don't even realize how bad their software design is because of prevailing norms, and the state of affairs can only be upended by certain developers showing that an…

prometheus76on Hacker News • Mentions

On “Available today: The Windows 11 2022 Update”

Replying to my own comment to add the proof that instead of double-digit fps terminal text rendering, he was able to achieve 4-digit fps terminal text rendering after a weekend of coding: Part 1 (Proof of concept): link to this video Part 2 (more features added): link