3 ms·
> In any case, a lot of the slowness we pay for toady is in exchange of actually being able to deal with the complexities necessary to achieve those things in r
by dmitriid 5y ago
> In any case, a lot of the slowness we pay for toady is in exchange of actually being able to deal with the complexities necessary to achieve those things in reasonable time/cost.
This is also debatable at least.
Just a few weeks ago it turned out that the new Windows Terminal can only do color output at 2fps [1].
The very infuriating discussion in the GitHub tracker ended up with a Microsoft tea member saying that you need a " an entire doctoral research project in performant terminal emulation" to do colored output. I kid you not. [2]
Of course, the entire "doctoral research" is 82 lines of code [3]. There will be a continuation of the saga [4]
And that is just a very small, but a very representative example. But do watch Casey's rant about MS Visual Studio [5]
You can see this everywhere. My personal anecdote is this: With the introduction of new M1 macs Apple put it front and center that now Macs wake up instantly. For reference: in 2008 I had the exactly same behaviour on a 2007 Macbook Pro. In the thirteen years since the software has become so bad, that you need a processor that's anywhere from 3 to 15 times more powerful to barely, just barely, do the same thing [6].
The upcoming Windows 11 will require 4GB of RAM and 64GB of storage space just for the empty, barebones operating system alone [7]. Why? No "wifi works reliably" or "trackpad doesn't suck" can justify any of this.
[1] https://twitter.com/cmuratori/status/1401761848022560771 https://twitter.com/cmuratori/status/1401761848022560771
[2] https://github.com/microsoft/terminal/issues/10362#issuecomment-862844333 https://github.com/microsoft/terminal/issues/10362#issuecomm...
[3] https://twitter.com/cmuratori/status/1405356794495442945 https://twitter.com/cmuratori/status/1405356794495442945
[4] https://twitter.com/cmuratori/status/1406755159347130371 https://twitter.com/cmuratori/status/1406755159347130371
[5] https://www.youtube.com/watch?v=GC-0tCy4P1U https://www.youtube.com/watch?v=GC-0tCy4P1U
[6] https://gadgetversus.com/processor/apple-m1-vs-intel-core-2-duo/ https://gadgetversus.com/processor/apple-m1-vs-intel-core-2-...
[7] https://www.microsoft.com/en-us/windows/windows-11-specifications https://www.microsoft.com/en-us/windows/windows-11-specifica...
- dmitriid 5y agoAs luck would have it, here's the continuation to Windows Terminal. Casey Muratori made a reference terminal renderer: https://github.com/cmuratori/refterm https://github.com/cmuratori/refterm 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): https://www.youtube.com/watch?v=hxM8QmyZXtg https://www.youtube.com/watch?v=hxM8QmyZXtg
- kilburn 5y agoTo play devil's advocate, what I see in that demo is that: - Yeah, some lower-level stuff seems to be broken (the windows console I/O stuff). - Microsoft's devs linked to a very nice website that quickly and nicely explains some of the quirks of modern text rendering [1]. - Casey proceeds to demonstrate a (very fast!) approach that completely ignores some of the problems laid out in that site. Namely, his entire approach is based on caching rendered glyphs, which the document explicitly states is something you can't do naively and expect correct results (section 5). - In his very demo some of these issues pop up (terrible-looking emojis, misaligned ascii art) and he shrugs those off as if they were easy jobs. - Other issues are never tested in his demo. Examples include: (i) dealing with text selection, which is hard according to the linked site; (ii) how is he "chunking" non-asscii character runs (also hard to do correctly); (iii) handling ligatures (terminal programs oftentimes use ligatures between basic ascii character combinations such as => to make some source code more readable) In other words: I see an incomplete solution that addresses only the easy parts of the problems (in a very performant way!) that fundamentally cannot be extended to a correct solution for the actual/full problem. And a lot of arrogance while presenting it. In no way does this mean that a much more performant solution doesn't exist. But Casey's cute demo is not a proof that it does because it does not solve the actual/full problem. PS: I don't work for MS, I don't know Casey nor any of MS's devs, and I don't even use windows. I do hold a PhD though, and I know plenty of PhD's dedicated to exploring the nitty-gritty details that some people with only cursory knowledge about the problem would dismiss as "this must be a quick job". [1] https://gankra.github.io/blah/text-hates-you/ https://gankra.github.io/blah/text-hates-you/
- jiggawatts 5y ago> caching rendered glyphs, which the document explicitly states is something you can't do naively and expect correct results But very slightly less naively you can get correct results. One trick is to realise that ClearType only increases the effective horizontal resolution. Also, despite appearing to have three times the horizontal texels available to it, the final post-processing to reduce the colour artefacts means that the effective resolution increase is only about double the pixel count. So you can get very good results by horizontally stretching your glyph cache buffer by a small factor, typically three. This is not a huge increase in memory usage, and provides more than sufficient subpixel positioning quality. Where this breaks down is if your pipeline has very complex text special effect support, such as arbitrary transforms. But a terminal emulator needs very few special effects. It doesn't need to be rotated smoothly through arbitrary angles, which DirectText supports. It doesn't need perspective transforms, or transparent text, or a whole range of such exotic features. In fact, 99.99% of the characters drawn by a terminal emulator will be plain ASCII aligned to a simple grid. This is a trivial problem to solve, as demonstrated in this thread. It's not PHD work, it's homework.
- astrange 5y ago> In the thirteen years since the software has become so bad, that you need a processor that's anywhere from 3 to 15 times more powerful to barely, just barely, do the same thing [6]. That is not "the software" unless you count EFI, the sleep process is mostly a hardware thing and controlled by Intel.
- AussieWog93 5y ago>But do watch Casey's rant about MS Visual Studio [5] "As an online discussion about software bloat grows longer, the probability of a Casey Muratori rant being posted approaches one."