I don't understand why desktop app user interfaces aren't blazingly fast and 240fps.
That being said, I think current iOS and macOS can run their UIs at 120fps (and Apple devices still seem to have decent battery life.)
Telemetry back to HQ takes resources.
I began to notice my disk drive light flickering regularly even when I was doing nothing with the computer, and the computer started seeming sluggish. I'd look at the process list, and started randomly forcing them to quit. Suddenly, the drive light stopped flashing. I'd found my man.
Googling the name of the process, it belonged to a program I'd bought that served media files to my Roku box. But I wasn't asking it to stream anything at the time.
I didn't know what the hell it was doing, but couldn't justify it, and removed the program.
Maybe it was indexing.
Unfortunately, even if you have very fast drawing, there are plenty of other ways to make software slow. But high performance GUI software is the main thing I'm working on at the moment and I expect to have interesting results in the coming months. If nothing else, it should be a data point of how fast GUI software can be.
Unfortunately it's not this simple. Unicode and multilingual support means you can't possibly generate a single bitmap to contain all possible characters. Modern UIs (including text editors and terminals) generally support various zoom levels, which requires re-rasterizing glyphs at different zoom levels. This means you typically have to rasterize vector graphics (your font) on the fly as needed and then update your bitmap.
Edit: Also, emojis and certain scripts require composting multiple glyphs together. This means you have to figure out which glyphs are required for your codepoint and use your font metrics to composite the glyphs appropriately. Then throw in mathematical notation and all bets are off.
My point is, rendering text is not a simple done deal, but it's also not an impossible feat and it can be done efficiently.
vector graphics are not rendered directly to the screen. fonts are rasterized first, then the rasterization is what the GPU receives.
lmao welcome to HN, if you don't enjoy that experience I don't recommend you try to argue here.
What difference does it make if you're caching the rasterization or not? You're still rendering vector graphics. And you're not just rasterizing once.
Modern font renderers can't get away with rasterizing glyphs once and reusing them anymore than arbitrary vector graphics renderers can. I sure hope my vector graphics editors cache the rasterizations instead of re-rasterizing needlessly.
it's not every frame. that's my point. that you missed twice because you can't see past details to the point of the statement.
> figure out which glyphs are required for your codepoint and use your font metrics to composite the glyphs appropriately.
this is all done in shaping though, the renderers just see "put this thing there" and (at least in GTK) we just maintain texture atlases that are updated on the fly.
you're correct that it doesn't solve the same glyph at lots of scales though. but glyphy does (and at high FPS too).
To be clear, I'm not bashing on GTK. I'm saying that it definitely isn't as simple as the above comment implies ;)
the bitmap stuff still has major drawbacks though, like maintaining grid alignments and pixel boundaries where as this stuff (mostly) goes away using glyphy.
still work to be done around hinting though (hence not merged).
Also, on Windows, the "acrylic" thing is a circus show. Every app behaves differently. It also manages to sometimes lag on an RX5600. I know it's an "old" gpu, but still...
But in most contexts, it is not necessary to render vector graphics 'live'; caching is acceptable, so this should not be a bottleneck for most desktop software.
Bitmaps are much faster to draw and can be made pixel-precise up front. With vectors it's easy to have pixel cracks or blurry lines because it's offset .5px.
yes, but that alone doesn't require that bitmap graphics be used.
> With vectors it's easy to have pixel cracks or blurry lines because it's offset .5px.
only if your renderer or your artwork isn't done correctly; inkscape used to be notorious for floating point rounding errors showing up with very few manipulations of a shape.
it's also been very easy to very quickly rasterize vector graphics for some time. maybe not fast enough in the past I guess, but computers are certainly fast enough now.
I look forward to a time when UIs are just all vector all the time, and it's the monitor itself which rasterizes, thanks to a program that the attached device uploads as it boots up or as the monitor is connected.
it's going to get more and more difficult to continue increasing display resolutions and refresh rates over long inexpensive cables if we continue to rasterize on a computer and push raw pixels to the display device.
Sure there has been, in the form of the nvidia path rendering extension. https://developer.nvidia.com/nv-path-rendering
It works great, on nvidia cards. Adobe Illustrator on Windows makes good use of it. Calling the extension from C/C++ and Python is no big deal.
The same critique for Apple applies all the time, when you are completely vertically integrated and make your own chips up to the very software running on them, it's kinda easier.
That aside, there's no display offering above 60Hz IIRC in the Apple line. Correct me if I am wrong.
Keeping startup really fast and all interactions really fast is more challenging than it seems.
This is not the whole story, but one example of the differences in perception.
There are game-like UI libraries (https://github.com/ocornut/imgui) but to use them you have to write your program like you're a gamedev and Conway's Law usually fights that.
1. Avoidable: The main one here is shader caching. Shaders could be precompiled for every supported card/driver, but that's more work than anyone is willing to do. Even so, some games (like Rust) have an excessive amount of shaders, which adds a lot of extra waiting time.
2. Unavoidable: The main one here is textures. If you want it to be quickly accessible in VRAM, then it's going to be uncompressed, which means either having some very large files to copy over, or having some semi-large files to decompress. You can save quite a bit of time by micromanaging the texture resolution of each asset to be just high enough. Apart from textures, you have vertex data and other assets; all of which have basically the same considerations.
When it comes to regular software, most UI designs don't have big assets. They aren't loading billions of triangles or thousands of textures. This means there really isn't much need for long startup times.
At least you could thank Microsoft for being backwards-compatible.
I've done this with calc.exe since ~Vista.
the Notepad team
That's probably part of the problem --- Notepad is something that could be written by a single person in less than a day (it's not more than a wrapper around a Win32 multiline editbox.) Yet give a whole team of multiple people the task of "modernising" it, and work will magically appear to fill the available resources.
That said, I've not encountered the same slowness issues since updating that are discussed here. I'm not a fan of the menu animations, but it's a minor nitpick. For editing huge texts it is significantly more efficient, in my experience. I remember turning off word-wrap in the old notepad after loading a huge log file, then having to wait minutes for Notepad to become responsive again.
Yeah, I know, anecdata....
Edit: The source code to the older Notepad is rather easy to find online. I won't link to it, but it's an interesting read.
The WinUI parts and initial launch cost, however, are somewhat hard to forgive.
I tried it. Everything in the File Open dialog got disabled except for the cancel button for about 30 seconds until it loaded. For comparison, curl took 2.3s (250ms in later runs so probably waiting for curl to load) and my browser took around 250ms with cache disabled as well.
Why does it take Notepad so long?
2000 lines is nothing. I routinely edited book length texts in Microsoft Word for DOS on a 4.77 MHz 8088.
If you mean that, I don't know how it relates to the comment/article since I never needed to do debouncing in a desktop context (only for embedded stuff with actual push button circuitry attached).
The classic example is a data table with a text field that filters/searches the results, pulled from a server.
Let’s say you want the results to update “live” as the user types, without having to click a “search” button. So if the user types “bacon” then she sees all results that contain the word “bacon” in them.
Problem is, if the act of sending the text field input to the server and waiting for the results is relatively slow and blocks the UI from updating, then each key press causes a delay between the search results updating on the screen, and the next letter showing up in the search field.
1. User types “b” and then the app sends “b” to the server, pauses, gets a response of all results with the letter “b”.
2. User types “a”, and the app sends “ba” to the server… pauses… gets results. She types a “c”, the app sends “bac”, etc.
Debouncing, then, means the app waits a short period of time to make sure the user is finished typing before sending the search term.
Usually this means every time the user enters a letter into the search field, the app sets a timer for, say, 500ms. If the user doesn’t enter another letter for 500ms, great - send the search term, wait for the results.
If the user does enter another letter within 500ms, then she must still be typing, so reset the timer back to 500ms and hold off on sending the search term out to the server.
I would expect the changes to be visible ideally in the next frame, but I guess that’s not really an option?
The compromise would be to always start rendering immediately rather than wait x ms, but if you detect that the previous rendering hasn’t completed when the next input has arrived then you can start debouncing before rendering until you catch up.
When a user inserts to backticks, insert the closing backticks immediately.
And now explain how anyone can ever turn existing text into a code block if every user action is "modified" to not turn existing text into a code block.
> And now explain how anyone can ever turn existing text into a code block if every user action is "modified" to not turn existing text into a code block.
At no point did I mention that you couldnt wrap code in bacticks, I simply said the default insert would NOT have single pair backticks opening up to a forced re-render of every trailing element.
IntelliJ was killing me until I figured this out.
Applications are simply not well written and most developers are incompetent and unaware of how incompetent they are.
Markdown+ is parsing and rendering your Markdown in real time. It may be slower than it needs to be, I haven’t used it and don’t know, but it’s doing a lot more work than 1982-era MS Word was.
You can still get blazing fast speed for even gigabytes of Markdown if you use instead use something like BBEdit on a current Mac, which would be the equivalent modern user experience.
If I'm actively editing a markdown file, I do not need for it to fire off a re-render on each keystroke. It can wait 500ms before starting to do it, and cancel if I hit another key in the meantime. If I start typing after it has started rendering, then go ahead and finish that cycle while still showing me what I type in real time.
However these events are scheduled, the appearance of my typed characters on the screen is going to always be the priority. There's no reason to block UI while doing this.
TB is a multithreaded program, but it isn't very good at using it effectively. I've learned through bitter experience to not touch a key or the mouse when it is getting messages.
Modern Word lags on a two-page document on an 8 core xeon with 64 GB of RAM. Same PC can run modern games at 4k@60 FPS.
I can agree that maybe modern Word "does more work" than Word 97. But as another commenter said: WTF is that work? And do we even need it?
As a user, all I see is that modern Word's interface has buttons all over the place, taking up half my screen. And when I grab the scroll-bar, it won't scroll until some time after I've released it. Word 97 managed to scroll the contents as I moved the bar just fine.
It also takes forever to start-up on an SSD so fast it can move multiple times the size of that old 486's whole hard drive in one second. WTF is it loading? And once loaded, why is it so slow, since everything can fit in RAM?
That's the point of gp's comment. The software is doing a lot of "work" that it does not need to do, thanks to poor programming.
Work is activity that helps to achieve a goal. Whatever Win11's Notepad is doing, it is not that.
If indeed premature optimization is the root of all evil, then I have lots to atone for.
At least, they have fix it in the most recent version of windows ....
It just keeps getting worse. I mean how hard is it to do nothing and leave these old apps alone?
Now they load up the monstrous libraries they need to negotiate a way to communicate with the desktop, and then negotiate that. A screen buffer is so yesterday, so I guess they have a scene graph now that some library renders whenever a pixel might have changed, triple-buffered to prevent artifacts.
there is fogies complaining about change, then there is making things objectively worse for zero gain. christ
and they are releasing a new taskmgr on win11 to boot
Which is borken. In the performance tab, I often see the right-hand side elements cut-off (like RAM size, etc) even though there's still space left in the window. Resizing it brings the text back.
But hey, at least it now supports dark mode!
game development is an entirely different paradigm than enterprise software development; they aren’t really comparable, other than they both produce software which successfully executes.
in games, any code which does not directly contribute to the final product is not written, or is removed after it is not needed. in enterprise software, tens of thousands of lines of code are produced simply so the project layout is familiar for everyone working on it, because that’s important, somehow?
Casey was right to complain about the performance, and to show them how it should work. licensing it so that they couldn’t even look at it was both 100% intentional and 100% a dick move, and i will not credit him for that. that code could have been used as a wakeup call regarding performance for a lot of people within Microsoft, but he licensed it so they can’t even look at it.
perfomance of microsoft software isn’t great, i’ll agree. poking fun at them then hiding the code that was easy enough to write for him, but completely not obvious to the Windows Terminal team, doesn’t really make Casey the Software Quality Hero you’ve portrayed him as. Casey writes excellent software, don’t get me wrong. this particular example and series of events is not a high point in his career, to me.
You seem to roughly agree with this in your 3rd paragraph. Enterprise software is fucking awful despite spending an enormous amount of money on it, and that's because the developers and the development process and the SMEs and the managers and vice presidents are all fucking awful at their jobs. That's the reason. They're fucking shit-ass at making software. Just look at Microsoft Teams. This is not the defense you seem to think it is.
Besides, we're not talking about enterprise software driven by bloat from the demand-side. We're talking about notepad and the console.
Marketing and legal is stellar though.
Enterprise software written 20 years ago still runs and works. I can still install it from an Msi package
Half the android apps I bought 5 years ago don't exist any more.
In Google they would have cancelled, closed, relaunched and cancelled again.
Games are hit and miss, admittedly some run for decades.
But above all, they dont care
PS: you wouldn't believe how many tries it took to get my phone to accept the word "cruft" instead of autocorrecting it to craft. Dammit!
it’s not a defense at all, it’s my whole point.
enterprise software is absolutely lost, because following enormous sets of rules and enforcing those rules via management is FAR CHEAPER AND EASIER than hiring skilled people who don’t need those rules to produce good software.
if that isn’t the very definition of bad management and business practices, i don’t know what is.
enterprise software being a total shitshow is my point, because a shitshow is far better for shareholders in the short term. filling seats with dopes you hope to train is easy to measure. carefully harvesting the best talent is slow, expensive, and difficult to measure.
microsoft does that. all large publicly traded companies optimize for short-term gain at the expense of long-term loss.
game companies, the good ones, the smaller ones, don’t operate like that. there are shit managers there, too, but game companies attract the exact talent they need, almost by default. they care about what they create because not caring means bad reviews, low sales, no bonuses, and layoffs.
the punishment for writing shit software at any enterprise company is continued employment, and at worst, an involuntary lateral move to another position where software quality does not matter.
microsoft is an enterprise software developer. they are burdened with that management style just like a lot of our employers are.
I hear this claim all the time, but nobody is able to explain why they continue to grow profits.
It's because people like me don't care about user experience.
We get Teams for free in our M365 subscription. It's integrated with other stuff, it has APIs for automation and I can't be blamed for choosing MS.
I know this is a shitty argument... but seriously, I have many battles to fight, not wasting my energy choosing the best chat software.
Devs think a lot a about software quality and stuff, but that's often irrelevant for business. GP is wrong, MS knows exactly what they need to do to increase profits.
what it isn't is investing in quality and long-term success; it's betting that you'll be able to find some other short-term optimization in the future, and it relies on the stock market having a memory that lasts no longer than one year
> and it relies on the stock market having a memory that lasts no longer than one year
If that was true, you could easily make $billions shorting those stocks that you know sacrifice the long term. Let us know how it goes!
Everything Microsoft did in the 1990s was based on returning profit sooner rather than later. That's the whole point of "embrace, extend, extinguish": liquidate this technology and turn it into money as fast as possible.
Every time you make a decision which gives you money or profit today, and that decision is based on money alone, you are optimizing for the short term at the expense of the long term.
It is easier to think about when you think of personal finances. You can have a slightly bigger paycheck every pay period or you can set aside money for retirement. You can maximize profit today if you borrow from your own future.
I should not have said that Microsoft do this exclusively (and at this very second I'm not sure I said that) because they don't do that exclusively. It is a common approach to decisions regarding stock price and "shareholder value" however.
Are you aware of what happened to MSFT stock during the 1990s? The claim is not credible.
> It is easier to think about when you think of personal finances. You can have a slightly bigger paycheck every pay period or you can set aside money for retirement. You can maximize profit today if you borrow from your own future.
This is not what "profit" is.
optimizing for short term gain IS OPTIMIZING TO MAXIMIZE PROFIT IN THE SHORT TERM.
If your company does last long, and grows enormously, you are optimizing for the long term.
being a public company and having shareholders more or less requires you to increase stock price at the expense of almost anything else.
investors do not care if a company goes under, provided they get a handsome return on their investment beforehand.
Can be fine. There are plenty of computer game genres where security bugs are not fine at all and where you need to be super careful to not introduce nondeterminism as that would break the whole game, all while maintaining performance.
https://github.com/cmuratori/refterm/blob/main/LICENSE
It’s just GPL 2.0, what are you talking about!?
Are Microsoft employees vampires that will burn up instantly if they merely glance at GPL code or something?
This is sour grapes nonsense from Microsoft. “We don’t like your tone so we won’t even dignify your argument by considering it.”
At one point an MS employee said they would love to fix their code as suggested by Casey but he refused to even look at the YouTube video!
“I would love to hear your arguments but I refuse to listen to the sound of your voice.” is next-level dismissive.
perhaps you are not familiar with what the GPL requires of its users, and how wildly incompatible that is with what a company like Microsoft does.
Microsoft employees are forbidden from looking at GPL code (as well as other virally licensed code) because they may unwittingly reproduce some GPL code they saw in a large Microsoft codebase.
If that happens, and they are taken to trial over it, and lose, that entire codebase is now GPL. This is enough of a risk to them that MS employees have computers which simply can not view GPL code.
that is also why they would not watch the video; it isn’t about his voice, it is about the code visible on stream. additionally, watching a video of GPL code being written could be perceived as an attempt to circumvent the restrictions on viewing GPL code, and would likely get the viewer into trouble.
you not already knowing this bothers me a lot, given all the things you’ve said in this discussion. you are making a lot of assumptions that are just not true and basing your opinions on the belief that those assumptions are true.
this is very similar to why software at microsoft is as bad as it is generally; a lot of people assuming they know things they don’t know, and producing results which are more flawed than they needed to be.
Also, Microsoft employees work on GPL2-licensed Linux just fine, so something seems off in your story.
stuff that is not Windows Terminal but that lives in the Windows Terminal repo on GitHub gets shipped with Windows.
so, yes, there are very good reasons they can't license Windows Terminal via GPL.
WSL kernel folks get that repo whitelisted.
Also, it's not just WSL people who work on GPL software inside Microsoft. I guess they are magically expected not to subconsciously reproduce any GPL code in their work ever ;)
They're free to look at the approach and simply rewrite it.
They'd have to anyway to fit in with their codebase.
If by "look at the approach" you mean the "look at the code", then no. You're giving a step for your code to be considered a derivative work. If by "look at the approach" you mean someone read the code, made a specification, and then someone else that hasn't looked the code, made a program based on the specification, then yes. But arguably this isn't "simply rewrite".
Those aren't even baseless considerations. ReactOS project had paused development due to concerns that derived (read: rewritten) parts of leaked Windows code may have been used. It took years for ReactOS to show that everything was in fact a clean-room implementation (basically doing what wrote above). If they hadn't, they'll have made themselves open to be sued by Microsoft.
You can not. So what do you do to prepare for a lawsuit which alleges that you've copied GPL code into the Windows codebase? You have technical and legal barriers in place so that those developers can't see GPL code where you can control that, and make them promise that they won't do anything to compromise the license of the Windows code that they work on. Technical and legal (read: contractual) measures to prevent this are the defense that one needs to have in order to defend against a case like this, in court.
So, because you, as a Microsoft attorney, can't guarantee that GPL code won't be reproduced verbatim in any quantity in the Windows codebase, you do what you can to dissuade your developers from looking at GPL code.
please think for 2 seconds on your own and I won't have to ELI5.
I don't mean simply renaming variables or changing a couple of lines.
Algorithms, being purely functional, are not copyrightable in any country that I know of. So a new implementation that uses the same algorithm as the original, but without copying any of its non-functional aspects, is not a derivative work of the original and does not infringe its copyright.
Cleanroom reimplementation is a defense against allegations of copying, because under, for example, US copyright law, access plus substantial similarity is sufficient to show copying. The "He's So Fine" lawsuit is one of the most extreme examples of this doctrine. Cleanroom reimplementations are a defense against copying by eliminating the access element. But copying the functional aspects of a program does not meet the "substantial similarity" bar.
No.
To give a very concrete example: french singer Claude François made the song Comme d'habitude: https://youtu.be/avr5nvY4wxg
It was translated and rewritten a few times but he still is recognized as one of the copyright owners on those covers, e.g. https://youtu.be/qQzdAsjWGPg which are definitely not just a mechanical rewrite of the original score
Well, at least unless you end up as big as Led Zeppelin was before someone catches you, I guess ;)
Are you talking about the Led Zeppelin who get entangled in judicial pursuits for plagiarism every couple years? If it was as clear cut as you say it is it would never reach any judge.
There is even one case where someone was condemned for not copying any specific song but the general style of another musician : Pharrell Williams had to pay 5M to the Marvin Gaye estate because of this
https://rpjlaw.com/blurred-lines-copying-songs-musical-style...
https://www.jonesday.com/en/insights/2018/07/blurred-lines-b...
Yes, this is extremely shitty but this is the world we live in
Yes, I intentionally mentioned a song "by Page – inspired by Jake Holmes": https://en.wikipedia.org/wiki/Dazed_and_Confused_(song)#Led_...
> The Ninth Circuit stated that the appeal was decided “on narrow grounds” and that the “decision does not give license to copyright a musical style or ‘groove.’”
What a pile of bullshit. I wasn't aware of that case.
More like will legal drain life from developers if they hear they looked at GPL code.
We had to switch DB drivers because legal didn't want to deal with GPL. Imagine writing code based on it...
yes it does seem perfectly fair, doesn’t it? it isn’t. the amount of work that needs to be done always outscales the ability to do the work, forcing prioritization. the Windows Terminal team is not large, and just throwing people at the team will not make it faster.
> "They don't have the experience to make it good" is pretty chickenshit.
you’re very unpleasant already. second sentence, calling me chickenshit. classy.
how many people do you know who are capable of writing what Casey wrote in two weekends who also DON’T work on games full-time?
i don’t know any people like that. so, where do you think those people go to work? on Windows Terminal? like that’s a common career path for someone like Casey? i would be absolutely flabbergasted if there were someone on the Windows Terminal team who knew how to do what Casey did before he did it. “Hey, come work on the command prompt” does not attract people who understand how to dynamically generate a texture atlas of code points and use that atlas to render a texture representing the console window contents 60/120/144/240 frames per second. the people that know how to do that are already spoken for.
THAT is precisely the problem!
What Casey did was not some unique and special solution known only to dark wizards working on AAA game engines.
It's an obvious solution that has been implemented many times before by many people for many systems. All green-screen and DOS-era terminals work this way, for example.
Admittedly, I'm a former game engine developer, but I went into that career with essentially zero industry experience of any type. I just muddled my way through a C++ textbook and started writing a game engine.
I needed a text console for my game engine, and I also needed to display Unicode text because we were targetting an international market.
Completely naively I wrote a "text engine". It took about a week, and my solution was virtually identical to Casey's. The difference was that I was slower at implementing it, and Casey's is more feature complete, but the approach was identical.
I didn't go to Hogwarts School for Game Development Wizardry. I just thought about the problem and applied the obvious solution.
The difference between people like Casey and the Microsoft team is not necessarily aptitude, but attitude. The Microsoft team has no mechanical sympathy and no interest in quality.
They made arguments not just along the lines of "this is impossible", but also "nobody needs this".
Through every fibre of their being they believe that computers are slow and that this is fine.
lol no they do not. absolutely not lol
> The Microsoft team has no mechanical sympathy and no interest in quality.
I know people at Microsoft. I have acquaintances on the Windows Terminal team. this is just plain factually incorrect.
Those character generators don't do rescaling and linear interpolation of the texels, and often they're only one-bit color, but that's extra work refterm is doing that DOS-era terminals weren't doing. It wasn't that Muratori invented a new, more efficient way to do things; he just reproduced the bitmap character-generator approach that was standard from 01975 to 01985, but runs it on faster hardware. So he got about 160 megabytes per second before optimizing, ten times faster than Windows Terminal, and 1600 megabytes per second after he "put in the most basic optimization [he] could think of".
It isn't necessary to do character generation on the GPU to be responsive, either. The Alto running Smalltalk took maybe a second for its ≈0.5 MIPS CPU to redraw a screenful of proportional text, say about 2kB. The original Macintosh took maybe 100 ms using a 1-MIPS CPU and hand-optimized assembly. But the laptop I'm typing this on is about 34000 MIPS so it ought to be able to do the job in ≈3 μs. My word-wrapped proportional-font experiment in http://canonical.org/~kragen/sw/dev3/propfont.c gets 72 MB/s, which works out to ≈30 μs per 2-kB "screenful". Valgrind says it's running about 113 instructions per byte rendered, suggesting my C is closer to Smalltalk performance than QuickDraw. It's still 20× as slow as refterm but it's not using the GPU, but 5× as fast as Windows Terminal. (On the other hand, it doesn't draw to the actual display, just a memory buffer which it outputs to a PNM file at the end.)
My own unoptimized monospace terminal emulator running on the CPU with a full-color font https://gitlab.com/kragen/bubbleos/-/blob/master/yeso/admu-s... takes 6.9 wallclock seconds and 3.1 CPU seconds to display the output of yes {1..90} | head -c 1000000. This is enormously slower, only 145 kilobytes per second or 323 kilobytes per CPU second, a whole 14 milliseconds per 2-kB screenful. (And its screen really is 2 kB.) This is 1000 times slower than refterm and 100 times slower than Windows Terminal, and it still doesn't handle the difficult cases like combining characters, double-width CJK characters, and RTL text. Probably I should optimize it!
I have no idea who could match what, but Windows is just an utterly massive product, they have the resources to make the whole thing shine, even if people really don't want to work on it and need big bribes.
Regardless, this isn't about Casey. This is about MS releasing crap software. Text editors from 30 years ago were faster than WT. Something is horribly broken about the programmer's approach to writing code, or they are being horribly managed, or all of the above.
On the surface, it often feels like there is just an extreme lack of pride in workmanship. In code from lots of vendors I am constantly seeing interfaces with strange glaring issues, with bizarrely convoluted UI paths, with odd render bugs, etc... It feels like there is something unfortunate happening across the industry. Maybe I'm just a cranky older engineer, but seeing so many visual and functional failures being shipped makes me think the issue is far deeper than that.
it is when you know that Microsoft employees are forbidden from looking at GPL code because they may unconsciously recall it and use it in a Microsoft codebase.
Casey knew that at the time and admitted to licensing it GPL for that exact reason.
That is a “dick move” to me. maybe i’m wrong. you be the judge, i guess.
so difficult that he wrote it so he could demonstrate how easy it is.
he gladly showed the rest of us how to do it, and he intentionally took action which prevented anything he did from being used within Microsoft. Microsoft is so shitty because they don’t know [thing] so i’m going to show everyone but them how to do [thing].
he could have chosen to help. he chose to not help. he chose to complain and ridicule while intentionally avoiding doing anything to change the situation he was unhappy with.
they were not caught using his solution. they published a blog entry describing that they were made aware of performance problems and they didn't mention him. it was rabid fans of Casey that started foaming at the mouth then, even though Casey publicly stated he didn't want or need credit, because the idea wasn't his to begin with.
For anyone interested about the blog post drama check https://twitter.com/cmuratori/status/1522468481135902725 (hn discussion: https://news.ycombinator.com/item?id=31284419)
Personally I think that he owes them nothing, especially after the way he was treated in https://github.com/microsoft/terminal/issues/10362 so I can't comprehend statements which claim that he was an asshole for using GPL.
I'm saying he could have helped the situation, and he deliberately chose to not only avoid helping, but to hinder anyone at Microsoft who wanted to look at that code and contribute to Windows Terminal. That was a choice he made intentionally.
He could have taken the high road, there. He chose not to. It's his choice, don't get me wrong, he was well within his rights. I just disagree with that choice. that's why I call that a "dick move". And if you disagree with me, that's fine. "Dick move" means different things to different people at different times.
He was right, but he does not seem remotely pleasant to work with and has been remarkably adversarial. Hasn't exactly fostered a "let's hire him as a consultant" relationship.
Isn't that exactly what Copilot does?
no, that is not what copilot does unless you check the box (or fail to uncheck the box) that allows exact matches of code from public repositories.
https://docs.github.com/en/copilot/configuring-github-copilo...
actual users of copilot seem to know this little bit of information; commenters who like to make comments about things they have never used always overlook details like this, and perpetually restate the things they learned about the topic months or years prior, even when those details were incorrect at the time, and are still incorrect today.
I see. But the setting (which surprises me that is opt-in) merely checks whether the output is an exact match and forces the system to produce a new output. The system can and does (as seen on the tweet) output verbatim code. So the question that parent commenter asked is legit.
I will restate what many others have said here, Microsoft has used and interacted with GPL2 code longer than I have been alive. There is GPL2 licensed software in the Windows Store released by Microsoft.
Microsoft is the one doing the "dick move" by requiring special permission for new GPL2 interaction.
If Microsoft can interact with Linux, the biggest GPL2 project ever, they can interact with whatever Casey releases.
they can't adopt GPL in that repo and Microsoft has a very strong policy about segregation between developers who can read and write GPL code and those who cannot. those who cannot interact with GPL code get to work on stuff that ships with Windows, like the stuff in the Windows Terminal repo.
so, no. they can't look at GPL code, including Casey's refterm code. Casey knew all of this when he chose the GPL for that project.
As for the segregation policy, it sounds like a self-imposed problem.
Like others have said, there are organizational issues causing the company's output to be embarrassing trash. Personally, I blame the Ballmer years of "unregretted attrition", but that's just my pet theory as to how it became a dysfunctional bureaucratic treacherous pirate's den
Surely you understand why something like this may be genuinely beneficial for application software even when it's not needed for games?
it's stupid.
You are moving the goalposts.
the result is very large projects because no one knows how to write code, and tons of unnecessary abstraction and boilerplate stuck onto EVERYTHING.
just write what you need to solve the problem you need to solve, then stop.
Also, though, it does not require 25+ years of game development experience to figure out that you can write a non-laggy terminal emulator, which should be obvious because people have been building non-laggy terminal emulators since at least 01974 and people routinely watch 1080p videos at 60 fps on modern laptops and even modern hand computers.
We had terminal emulators with acceptable, even snappy, performance on X-Windows when I started using it in 01993. In 01994 I would commonly use an IRIS Indigo, which had a 150 MHz R4400, which was not superscalar, so it was maybe capable of 150 MIPS, or 300 MIPS if you count floating-point too. I preferred using it instead of the X terminals because it was faster. I'm typing this on an obsolete laptop whose CPU averages about 100 times faster than that. It's immediately obvious to the most casual observer that there is no excuse for software on this laptop to flub UI tasks the Indigo handled with ease.
The VT50 https://en.wikipedia.org/wiki/VT50 was released in 01974, and its microprogram emulated a Teletype with added features. (See my comment at https://news.ycombinator.com/item?id=32547666.) A service manual for the 01975 version, the VT52, is at https://news.ycombinator.com/item?id=32547666. It had 60 frames per second (in the US), 240 scan lines per frame, 80 characters per scan line (at 15.36 kHz), and I think 8 pixels per character (in each scan line), one of which was always blank. So its output shift register ("VSR") operated at 9.8 MHz, or actually a little bit faster because of the 10-μs HBI, during which it checked the keyboard. Its microprogram, which had to load the appropriate 7 bits into the VSR 80 times per scan line (as well as processing escape sequences and printable characters during, I think, the VBI), had a 1.3 μs instruction cycle time (770 MHz), divided into 18 72-ns clock cycles (13.824 MHz) during which it did different things.
So I think that in most 72-ns clock cycles about a couple of dozen flip-flops would change state.
This laptop typically executes about 2400 CPU instructions in every 72-ns tick of the VT52's clock, 600 per core. You could compile an RTL-level logic simulation of the VT52 into C and compile it with a C compiler, and it would run faster than the original VT52.
But that would be sort of stupid because you have a framebuffer and a GPU with texture-mapping units; your CPU doesn't actually have to generate pixels one at a time to keep the screen refreshed because you have hardware to do that for you. A 1920×1080 video at 60 frames per second is displaying 124 million new pixels per second, which it has to get by decoding H.264 or H.265 or something. That's a bit over 1.5 million VT52 characters per second. But when you're displaying characters on a terminal that isn't very useful because people can only read about 30 characters per second; even updating a full-page 80×66 display at 60 frames per second is only 0.3 million characters per second.
In most cases the computation required to process a character is to verify that it's a printable plain ASCII character, update the screen image, and update the cursor position. Updating the screen image might involve blitting some texture data or, as in Muratori's refterm, updating a glyph index that gets consulted by a shader to figure out what texture data to draw when the time comes to render a frame. We're talking about an amount of computation that's small compared to a typical C subroutine call and return.
no! it would not! the GPL is a truly awful license. "freedom" my white butt. it's a list of requirements, all of which restrict the freedoms and abilities of those who utilize it.
about rendering:
I'm not trying to say that it's hard. I'm trying to say that they believed they knew how to do it, when in reality they did not.
THAT'S ALL.
Everyone is laser focused on the details of what I am saying and completely missing the point of what I am saying, or trying to say. I am apparently speaking a language that is close to English but not actually English.
The only freedom the GPL restricts is the freedom to maintain a captive audience in a state of information asymmetry guaranteed helplessness.
You're not making a good case for yourself here.
if I license something with the MIT license, anyone can use it for any purpose, and they can take my code with their modifications private if they want, meaning those entities are free to do what they want, and the code I released is still freely available just like it was before. I lose nothing, and no freedoms were taken from anyone who uses my code.
That sort of simple numerical counting isn't enough for an ethical argument, of course. If my house is converted to a public park, then everyone gains the freedom to drink beer in it, or at least everyone in Buenos Aires does, and only I lose any freedom, like the freedom to sleep in a dry bed when it's raining without raucous beer-drinkers guffawing all around me. But this is still a net loss because the benefits to everyone else are not as important as the loss to me.
In the Windows Terminal case, the situation is the other way around: Nadella would suffer a loss of freedom that affects him only in a de minimis way, while everyone else would gain substantially.
Have you considered that people are disagreeing with you because you are wrong rather than because they don't understand you?
And having the Windows Terminal licensed under the GPL instead of a Microsoft EULA would strictly increase the freedoms and abilities of its users: they could still legally do all the things with Windows Terminal they do now, plus lots of new things as well. Opt out of undesired updates, for example. Even the Windows Terminal team would have more freedom that way: they could go work at a different employer and keep hacking on the code they wrote as part of Windows Terminal.
(highly recommend Notepad3)
i don't miss the ceremony of trying to debloat Windows after every unstoppable auto-update; what a goddamn nightmare that was.
now permanently on EndeavourOS KDE/Plasma and everything "just works, very fast". i do wish that Affinity products where available for Linux, i dont think you can run them with Proton/Wine :(
If you asked me what a calculator app "should" do, none of those would ever enter into my brain.
Some (not all) of the lag in Windows is on purpose by the UI engineers. Google "disable windows animation" for a starting point on how to fix it.
Oh I remember that!
He even got lectured by some expert nitwits at MS which were making dozens of arguments about how it was allegedly impossible to create a fast terminal (on modern machines, most of them with GPUs in the TFLOPS range, LOL).
I have no idea why those "engineers" weren't fired on the spot.
Keyboard shortcuts, for example.
On my machine, Notepad still seems to have the traditional keyboard shortcuts. But in Paint they are completely missing.
Alt-F-A? No Save As dialog for you.
Close the app with unsaved changes? You get something like the traditional "do you want to save your work?" dialog, but the left and right arrow keys do not work in the dialog. And you can't type N or Alt+N for "Don't save".
These do work in the latest Notepad on my machine.
These keyboard shortcuts used to work in every Windows app, and especially in all the standard Microsoft apps. Now it seems to depend on whether the individual developer knows about them.
Media Player has apparently been replaced by "DVD Player(free)" which is not only intentionally crippled (you have to use the keyboard to access the DVD menu and if the Menu begin with no item having focus, you're SOL) but also crashes 75% of the time upon attempting to play the disk (I spent five starting the thing until I installed VLC).
The entire scheme is apparently to try to leverage the monopoly MS has on low-end systems.
> opening a 300 MB log file takes a solid minute of time
But notepad.exe is always slow when opening large files. If anything I think it's better now than it was in XP/7.
Unless you're using the same hardware, that's probably all hardware improvement.
With all the telemetry going on in the background, Windows is worse every day. I tried Windows 11 and was amazed at how it completely nullified having a top-tier mobile i7 paired with 32GB RAM.
Take a look at how much a modern install of Windows is thrashing your drive. It's scanning everything, all the time.
I'll give you an example.
I've seen developers and DBAs working on databases simply create new indexes on the fly to fix some performance issue. It takes ten seconds, it's fairly safe, and it is relatively easy to gauge the effect. "Before minutes, after milliseconds". Done.
I've seen other places where merely suggesting the use of an index -- no matter how beneficial, trivial, or safe -- resulted in everyone foaming at the mouth in abject terror. Wailing and gnashing of teeth. "How dare you suggest that we touch the mystical black box!? Begone with you, foul wizard!"
This is what I saw with the Casey Muratori vs Windows Terminal team arguments.
Everyone acts like Casey pulled out some dark tome only the most grey haired wizards are allowed to see and spoke secrets that Microsoft isn't even allowed to legally hear.
Do you actually know what he suggested?
Make a grid, just a 2D array. Put the characters in them.
Use the characters to look up small images of individual characters in another grid.
If the other grid is missing a characters, find an empty spot an replace it with the missing character image. (If the second grid is bigger than the first one, this is always possible.)
That's... it. Just array lookups, 2D images, and a hashtable.
This is child's play not wizardry.
No, that's not all that Casey did. I mean, perhaps from a very reductionist point of view it is, yes, but there's a thousand ways to implement "array lookups, 2D images and a hashtable" that are less efficient than the way that Casey did it (and probably most would be less efficient than the MS team as well...) Do you know the ins and outs of Direct2D in order to write all that out efficiently? I certainly don't.
Casey demonstrated... and it ought to be obvious... that the "ins-and-outs" of Direct2D don't matter.
If you actually bother to cache the glyphs into sprites, then Direct2D can be absurdly slow (it isn't) and still get something like 1000 fps.
Your comment is almost a parody of what went down.
How can you not see that generating a 16x20 pixel image can't possibly be the bottleneck on a modern PC unless you're doing something spectacularly wrong!?
I don't know what this means. Casey clearly uses Direct2D in his repo. If he were to demonstrate that Direct2D doesn't matter, he shouldn't have used it.
> Your comment is almost a parody of what went down.
There are thousands of programmers out there who haven't built a terminal as fast as RefTerm, and then there's Casey Muratori. If a hundred more Refterms show up tomorrow, I'll happily change my mind. Heck, you can even prove me wrong by coding one up yourself, if you'd like!
When I was something like 23 years old, my boss told me to go help optimise IIS performance at a large dev shop.
Think about how absurd it sounds: A junior tech with essentially no knowledge of IIS performance tuning doing consulting to an entire company of 30-40 year old experienced developers on the finer points of web serving.
I turned up, and it turned out that these guys were writing what seemed like a trivial web app, but if two people submitted a form simultaneously then the page would take a minute to submit.
A minute you ask? I timed it: 60 seconds exactly, plus or minus a few hundred milliseconds.
That's a lock timeout.
I asked to talk to the database team. They told me the scope of works was to look at IIS and "tune it". To put things in perspective, they were using the largest server I had ever seen (8 sockets!) and it couldn't handle two users.
"Maybe we need a 16-socket server, what do you thinkg?"
I told them... no-no-no-no, I need to talk to the DBA team, just trust me.
After some negotiation, I finally sat down next to the "senior" DBA and asked him what database engine he was using.
"Sybase."
Shit. I had heard of Sybase, but had never used it. I had a smidge of experience with SQL Server, and I had heard that Microsoft based it off the Sybase code that they had licensed.
In a mild panic I asked him if Sybase had any performance analyzer tool or somesuch?
"No."
Err... that's not good. Now in a cold sweat, I asked to borrow his mouse for a second so I could click through his Start menu, where I found the Sybase folder, with a "Profiler" tool that was a carbon copy of the "SQL Server Profiler", except for the icon and some color schemes.
It took about 10 minutes to repro the scenario and demonstrate that as expected, the codebase was Deadlock City and the mysterious 1 minute "performance issues" were in fact caused by 60.0 second timeouts as I had guessed.
When I walked away from that two storey building full of "professional" developers, I had a wide-eyed look on my face wondering why literally nobody in the entire database team was even aware of the existence of the database profiler tool... which was in their Start menu the whole time.
Many of us discovered around the age or 13 or 14 that POKE #B8000 plus a little arithmetic was significantly faster than using OS calls to write text to the screen. We were wrapping those in functions, inlining ASM, and building text-mode UIs as teenagers - not as long-time professionals, not college grads, and without all the information available on the modern internet.
Over the next few years, as graphical stuff became more common, we were trying different algorithms to optimize polygon fills, mouse drivers, custom fonts, etc. That was a part-time hobby for teenagers. Did not require greybeard gurus with lifetime achievement awards and college degrees and the entire internet of information always available.
It was just the basics, the fundamentals, a few decades ago.
In this way, users have nowhere to hide. Any refuge from the new UI changes will be tracked, identified and targeted for termination.
look at that- with so many wonderful words to chose from, why do people fall back on 'decimated' ?
Practically “Saw”, in real life.
https://www.merriam-webster.com/dictionary/excoriate
https://www.collinsdictionary.com/dictionary/english/excoria...
>c:\copy con FILE.txt
F6
VS Code, which is an Electron application, opens text files something like 20 times faster than the new Notepad.
Whoever wrote and shipped the new Notepad should feel ashamed at their failure as a professional software engineer.
This isn't some Github toy project. It's being forced onto billions of users, without the slightest bit of quality assurance or adherence to the basic practices of the art.
Steady on old chap. Who's to say the hapless developer isn't embarrassed about things themselves, but is prevented from doing the right thing by some management edict, ancient process etc.
My money's on that rather than one person's incompetence.
In fact, I have done similar things.
For example, I was asked to develop a protocol-shim for an authentication system used by tens of thousands of people accessing one of the largest SAP systems in the country. I wrote the code, tested it, and said to the PM that the only thing missing for go-live is some HTTPS certificates to make it secure.
He asked me to go to production anyway to meet his deadline, and that the certificates will be fixed up later.
I straight up told him: "No."
The look on his face was hilarious. He called my boss, my boss' boss, and up.
I told all of them: "No."
We waited for the certificates to be issued.
The new Notepad is not fit-for-purpose. You cannot use it to open a file several gigabytes in size. It'll just die, take minutes, fill memory, and even if it opens successfully, it'll be unusably slow.
It's the Windows equivalent of 'vi'. It has to work, all of the time.
I hate this argument so much
It's like being perfectly fine with a universe with as much suffering as long as no one is dying. I am exaggerating of course, but why inflict this suffering to a BILLION people? I feel bad when I annoy someone for a few seconds (like struggling to open a door) and yet people are perfectly nonchalant to create ecosystem that billions of people use everyday for the next decade at least.
Are you sure?
---- "Larry started to explain about some of the places where he thought that he could improve things, but Steve wasn't interested. He continued, "You know, I've been thinking about it. How many people are going to be using the Macintosh? A million? No, more than that. In a few years, I bet five million people will be booting up their Macintoshes at least once a day."
"Well, let's say you can shave 10 seconds off of the boot time. Multiply that by five million users and thats 50 million seconds, every single day. Over a year, that's probably dozens of lifetimes. So if you make it boot ten seconds faster, you've saved a dozen lives. That's really worth it, don't you think?" --- https://www.folklore.org/StoryView.py?project=Macintosh&stor...
And they should choose possible homelessness?
The original claim was that they were a failure.
The hypothetical is that they are not a failure, but are "prevented from doing the right thing". In the hypothetical, they should quit and get a new job.
You really don't do your argument any favours with exaggerations like this.
whoa there, you don’t know that. you think you do because you’re getting a ton of upvotes and you’re leaning into the feeling you had when you wrote that comment — the anti-Microsoft comment on a site known for its anti-microsoft comments.
if you don’t work at Microsoft, you have very little hope of understanding the motivations of a team, a product manager, or even a single developer within Microsoft. there’s a lot more there than meets the eye, just like there is at any huge company.
I do know what Microsoft is or isn't doing.
The evidence is in the pudding: opening a large text file in the new Notepad is orders of magnitude slower than any other editor on my system. This is a common failure mode that is trivially caught by testing. It's a well understood problem space, much like how databases "get slower" as the data volume increases, but the well understood solution is to use indexing to make this not occur.
The fact that the Notepad team spent months (years?) working on a trivial text editor and never tested it with text files speaks volumes.
If they had ever opened a large text file, they would have immediately noticed that a mistake had been made. Much like how if a database developer runs a query over large amounts of data, the missing indexes are immediately obvious.
It takes a minute for Notepad to open a file that isn't even "huge".
A minute isn't slow. It's broken.
They shipped broken software to the public, at the scale of hundreds of millions or even billions of users.
> understanding the motivations of a team, a product manager, or even a single developer within Microsoft.
Clearly, performance and quality are never motivations at Microsoft.
Their motivations are irrelevant for an end-user. Their results are.
If you don't think it should, I remind you that you can't take the humanity out of a human.
If you don't like how your OS works, pick a different one.
Windows force-updated my Notepad.exe to the new modern UI version.
It is very visibly laggy for basic actions such as opening menus or scrolling through text.
You have to be spectacularly bad at programming to make something so basic so slow in 2022 on a very high-end gaming computer.
Not just bad, but utterly oblivious. Casey Muratori excoriated the Windows Terminal dev team for failing to achieve a consistent 60 fps when displaying fixed-width text, which is such a trivial exercise that Casey whipped up a demo in like two weekends. [1]
Now the Notepad team insisted on following in the Windows Terminal team's footprints and slowing down the other fixed-width text app that needs to be lightweight fast for all sorts of reasons. Nobody needs Notepad to 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: https://www.youtube.com/watch?v=hxM8QmyZXtg
Second weekend: https://www.youtube.com/watch?v=99dKzubvpKE
[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.