37 ms·
Why modern software is slow
- KyleSanderson 4y agothe author used to ship latency sensitive software with -fPIC... great that they're advocating for this now, but major stalls were very common with their implementations.
- honkycat 4y agoSo sick of my laggy, jittery, POS gaming laptop. The hardware is great. The software has officially shit itself. Stuff like "guitar pri" lags it. Just constant memory spikes and slow downs. PATHETIC.
- bikamonki 4y agoThe beauty of irony: slow software rant published on Wordpress :)
- ern0 4y agoIt's a long-time design flaw at Microsoft. Long time ago, in Windows for Workgroups 3.11 times, when I opened Explorer, it was getting slower and slower. Finally, changing a directory took 5 secs. The hard disk was working hard (there were LED indicators!). I've figured out that the root cause was my C:\Documents directory, which contained a bunch of files, maybe some hundreds of mp3s, don't remember. Moved _all_ files from C:\Documents made Explorer lightning fast. I think, Explorer wanted to show a summary of different file types, which was completely unnecessary and couldn't turnded off.
- Narishma 4y agoThere was no Explorer in Windows 3.11, nor a Documents directory.
- dbttdft 4y ago> A twenty-second delay for recording a forty-second clip is a pretty bad efficiency ratio. What a weird way of thinking, I wouldn't hire anyone who says something like this. 20 seconds to load up or do just about anything on a computer is bad, regardless of some round about reasoning of ratios. I find these days there is something wrong with most developers' brains. Like we need to start a new parallel software industry and make sure no unreasonable people can be part of it.
- cd3k 4y agoDevelopers are using over-powered machines to build programs. Slower and less capacity machines lead to better programming optimisation. Ask anyone that knows about game console programming. Programmers can't tell when they're making slow programs because their computers make up for it.
- deterministic 4y agoThe modern software I write is very fast. It has to be. It is used to optimise pairing/rostering of very large airlines and rail companies. A single percentage of speed improvement has big impacts on competitiveness and customer perceived value.
- IncRnd 4y agoThere are loads of technical reasons, especially around how software is assembled today instead of created from "purpose-built programmning". But, ultimately the root cause is that programmers no longer create programs for users. They create programs (oftentimes just subsets of programs) for their managers. And, managers many times work towards MVP products instead of actually usable products for their end-users . The incentive for creating a user's program has become an incentive to complete quarterly assessments.
- fennecfoxy 4y agoThat's just bad dev, for a native app. But anyone complaining that modern Electron/Web apps have bad performance is naive. Of _course_ they do, and yes we should try to improve performance, but much of the industry as a whole has decided that features > performance for the most part.
- phendrenad2 4y agoModern software is slow because the tools which developers user are slow! I don't have time to hand-optimize my code, do you know how long it takes to run the full test suite?
- mjevans 4y agoProgrammers too abstracted from the impact of what's going on to realize where real slow spots might exist.
- throwawaysleep 4y agoI would be interested what percentage have ever opened it/used it? I extremely rarely use the software I write as intended. I am just running it against tests.
- tekchip 4y agoSo most of them. This sort of thing happens all the time everywhere. Unfortunately.
- stephc_int13 4y agoBecause it can is probably the reason (thanks to hardware). Making better/faster/more reliable software is possible and I think this is an opportunity that will only reach its full potential at some point in the future, when hardware improvements will be slow enough for this effort to be competitive.
- nyanpasu64 4y agoA very slow scan of the Documents folder, by RuntimeBroker.exe which manages the Store app sandbox, reminds me of Android apps waiting up to 10 seconds for the Android system file picker to list the contents of my Downloads folder since apps (kinda) aren't allowed to browse your files directly.
- deleted 4y ago[deleted]
- bogwog 4y agoCan any devs at Microsoft explain/speculate how this happened? Are these bundled apps simply unmaintained? Because it seems like this is a major and obvious flaw that is relatively easy to fix in a lot of different ways… yet it shipped. It’s easy to just say that Microsft’s developers are incompetent/dumb/etc but this is low hanging fruit, and makes me think the problem is something else.
- Mountain_Skies 4y agoNot a Microsoftie but it's probably going through various emulation layers.
- joe_guy 4y agoWhat emulation layers are you speculating there are?
- Mountain_Skies 4y agoWindows-on-Windows/WoW64, depending on the age of the application in question. Has the voice recorder application been updated in recent versions of Windows (or whatever version the author was using)?
- minedwiz 4y agoUnless we're talking running x86/x64 binaries on ARM or something, WOW64 is not an emulator, since x86_64 chips support IA32 instructions natively. There is some small overhead from filesystem and registry path translation, as well as switching the processor into/out of 32-bit mode. There is, in fact, a new sound recorder app on W11: https://www.pcmag.com/news/first-look-windows-11s-new-sound-recorder-app https://www.pcmag.com/news/first-look-windows-11s-new-sound-....
- ripley12 4y agoI don't work at MS, but there's a few potential things going on: Voice Recorder is pretty old, it got a big revamp/renaming ("Sound Recorder") in Windows 11. Problems might be fixed now? The native development story on Windows is in shambles. UWP and WinRT have a ton of baggage but there isn't a great replacement for them yet. Many bundled apps were written in UWP when it seemed like it was the future, and now they're in an awkward not-quite-unmaintained place. I see the trace is spending a lot of time in the Windows.Storage.* namespace and... there be dragons. Filesystem access from UWP apps is awful, it has several usability and performance shortcomings. Would not surprise me if that's a platform issue and not a Voice Recorder issue.
- dilyevsky 4y agoI personally blame the “premature optimization is root of all evil” quote which most of the time is taken out of context but formed a lasting impact in many tech leaders’ minds
- Jtsummers 4y agoWhy blame a quote, an inanimate thing, and not the foolish programmer that scans the entire `Documents` directory just to ignore most of it and only keep the results of the `Sound Recordings` subdirectory? (Among other apparent issues with this program.)
- dilyevsky 4y agoIt’s just an expression ofc i blame the engineers (actually mostly tech leads and management)
- dilap 4y agoI think that quote can often be the source of misguided beliefs like "it's OK to scan the whole Documents directory". 'Cuz why waste time doing something harder? Premature optimization and all that. Honestly, in my experience, basically the opposite of the quote is true. If you want your software to be fast, you need to be thinking about speed in the design from the very beginning. Very hard, perhaps impossible, to make something not designed for speed from the beginning be as fast as something that was. Of course there's a difference between having a holistic design that you know can go fast and immediately wasting time eeking out x% of speed in some random sub-fn that will only run y% of the time, when x and y are small. But really performance does need to be built into the design. (As an example, look at the heroic steps that are being taken to try to make the Rust compiler faster. It's slowly getting better, but it will never be fast. On the other hand, I would predict that if you started making a Rust-like-language from day 0 with a fast compiler as a goal, you could get something much faster.)
- pxmpxm 4y ago>If you want your software to be fast, you need to be thinking about speed in the design from the very beginning. Very hard, perhaps impossible, to make something not designed for speed from the beginning be as fast as something that was. This is absolutely true in low latency finance.
- mikewarot 4y agoOdds are someone who writes an app is doing it in a sterile environment, where there are only going to be a handful of test files in any folders. If they do try it on their own system, they'll likely discount any performance hits as due to their own hording of files, and not consider the user likely to have just as many, if not more files. Thus, its not likely the programmer will notice it. It's only if some exogenous event causes a programmer to consider run-time performance that it will be measured, and then optimized.
- notacoward 4y ago> there are only going to be a handful of test files Bingo. This used to be a well-known benchmarking cheat, because performance on a full (or even once-full) filesystem can be very different than on a freshly made one. Almost as common as short-stroking, if you remember that. Anybody who wanted realistic results would run tests on a pre-aged filesystem. Cache warming is another example of a similar effect, and there are probably others across every area of computing. It's always really tempting to run tests in a maximally clean environment to get maximally consistent results, but that just doesn't reflect real-world usage.
- koyote 4y agoAnother reason could also be the fact that devs usually only ever run development builds of the software. So you end up dismissing slowness due to this ("I am sure this is faster when compiled in Release!"). I've made that mistake before until it was so slow that I decided to compile a Release build which was just as slow and found out that a regression was introduced. Automatic performance monitoring for 'tasks'/services/computations is relatively straightforward but not quite as easy for UI interactions so these often get ignored.
- Dalewyn 4y agoThere are no incentives for bottom of the barrel programmers to write efficient and effective code, particularly when hardware in general have gotten so powerful and their own dev machines are probably overpowered for purpose.
- Gigachad 4y agoThe market doesn’t care. Making the program run in 1 second instead of 2 seconds takes the same effort as adding a new feature. The new feature empowers users more than saving a second, where they have the option of just buying a faster computer if they care.
- zardo 4y agoExcept this isn't a 1 second is good performance situation. Given the error the writer would need to buy a computer 11000x faster to make up for it. Assuming scanning 44,000 files instead of 4 takes ~11000x longer.
- Ekaros 4y agoMarket doesn't have options. There either isn't alternatives or you can't refund anything with reason of it being slow...
- Gigachad 4y agoThere are always options. And always those looking to exploit untapped opportunities. And in the subscription age, you don’t refund, you just stop renewing. There is no market for a photoshop competitor with half the features but runs faster for example. Because every tool is already tuned to be just fast enough that customers are satisfied.
- throwawaysleep 4y agoWhat incentive exists for any programmers to care about speed unless it is a real constraint? I’m not paid for a good user experience. My manager is happiest when features ship quickly.
- Mikeb85 4y agoThis blog post seems like a Windows problem specifically... That being said, in general, modern software is more bloated than ancient software because it does more...
- edflsafoiewq 4y agoI feel like "it does more" is often a cop out that's used without justifying whether the performance is actually commensurate to the additional features. If slowness if 20% extra features and 80% waste, "it does more" is just a deflection from the real issue.
- Mikeb85 4y agoWell, this blog post specifically seems like MS is doing 95% idiotic things. But you look at something like Linux where obviously the Linux of 2022 is going to lag on 2002 hardware the answer is definitely that it's prettier and does more in general.
- temphypercube 4y agoI run linux on 2010 hardware, and it's fine; perfectly snappy.
- themitigating 4y agoI remember waiting almost two minutes for Netscape Navigator to start.
- treeman79 4y agoImagine that was probably limit on hard drive read speed
- Jtsummers 4y agoAnd low available RAM paired with a slow hard drive and memory swapping.
- mod 4y agoI was in middle school. We called it Nutscrape. It was abysmally slow, agreed. But it wasn't a simple piece of software, either. This sound recorder is. And I'll let an expert chime in here, but I think we're many orders of magnitude faster now, on the hardware side.
- josephg 4y agoI bet Netscape 2.0 would startup more or less instantly on modern hardware. Modern computers are so bonkers fast that everything should be instant on them. I mean, new CPUs can do 5 billion cycles per second, per core. To have an operation take 1 second, someone wrote software so slow that the computer took billions of steps to do something. How wild is that! Whenever you have to wait for things on modern computers, you’ve essentially been robbed.
- tenebrisalietum 4y ago> 5 billion cycles per second IF everything is in the cache, there is no dependency on I/O, and cycles aren't wasted with context switching between usermode->kernel. Unless your program is purely computational it's going to burn cycles on system calls and I/O.
- 4y ago
- chris_armstrong 4y agoEveryone talking about the algorithm being slow instead of wondering why an app needs to do this in the first place. At the very least, this isn’t hugely useful, and if it was, why can’t it rely on a OS level file search cache to help it?
- masswerk 4y ago> why an app needs to do this in the first place This is – besides all those programming related oddities – a question of holistic UX: if collecting the list takes that long, make the list on-demand, hide it behind a button or documents icon – and already your app is responsive for the majority of use cases and users.
- layer8 4y agoMore importantly, why can’t you start recording before the file history has been populated? Those seem like two completely separate functions.
- spullara 4y agoInstantly starts recording for me on Windows 11 so maybe this was reported and fixed long ago.
- cratermoon 4y agoI wonder if the file scanning is hitting a variant of the N+1 problem, and if there's even a way to avoid that using the file system APIs. There's an old paper titled "New Need Not Be Slow"[1] that goes into the right and wrong ways to scan a filesystem for lots of files. 1 ftp://ftp.cs.toronto.edu/doc/programming/cnews.{ps,pdf}
- nicklaf 4y agoMinor correction: should be ftp://ftp.cs.toronto.edu/doc/programming/c-news.ps
- sixothree 4y agoSometimes opening a folder with Windows Explorer can take 15-30 seconds. Even when there are just a handful of files. It is very clearly scanning the contents of the files (so that it can sort them by date descending).
- KerrAvon 4y agoThat’s not usually how file systems are organized; modified date and such are part of the metadata along with the filename so that you don’t have to scan the contents of the file just to list it. If it’s really that slow for a dozen files, using some kind of performance tool may be in order to figure out where the perf is going.
- sixothree 4y agoActually it doesn't matter what the sort order is. This behavior exists.
- Valmar 4y agoLinux file managers manage to be nice and snappy. On my machine, KDE's Dolphin, on an NVME, takes, maybe, 4 seconds to open and scan a folder that has more than 9000 folders and files. What's Windows' problem? It has no excuse. Maybe, just maybe, the Windows Explorer, plus the stack it runs on, is utter garbage.
- fomine3 4y agoMy experience was opposite on directory with 30k files via SMB. Windows Explorer took within a second while Dolphin took 30 seconds. Nautilus took over a minutes iirc.
- projektfu 4y agoWindows allows a lot of middleware in Explorer. The shell extensions can eat performance like crazy if they get out of hand.
- hbrn 4y agoCounterintuitively, software performance as a whole is not a function of hardware, it's a function of human tolerance. Apps are as slow as we humans are willing to tolerate. As hardware gets better, we're finding ways to use it less efficiently. So if you want apps to become faster, you shouldn't be building better hardware. You should be changing human tolerance thresholds. Which is almost impossible to pull off. Apple did this when they released the iPhone. Remember mobile apps before iOS? Mobile browsers before Safari?
- MattPalmer1086 4y agoI like your take that human tolerance is the limiting factor. I'd agree that is a major constraint. The rest of it is just economics. When I started programming, people I learned from would optimise code in assembler, use clever algorithms and write highly unreadable code that was impossible to debug. One bit of code I remember interleaved various operations so that it's access would line up with disk reads. I rewrote it to just hold the data on memory. It wasn't much faster than his disk based code in practice. But the only reason to go to that kind of effort was the severe constraints hardware placed on software. When those are largely removed, the imperative is to write code fast that other people can still understand.
- nurbl 4y agoI think part of it is the terrible software people are forced to use at work, which is bought by people who only look at feature lists and price. This stuff eats away at their expectations until they are OK with bloated stuff like discord for private use too.
- jiggawatts 4y agoOh, this is nothing. 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 https://www.youtube.com/watch?v=hxM8QmyZXtg Second weekend: https://www.youtube.com/watch?v=99dKzubvpKE 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.
- sixothree 4y agoNothing annoys me more than having to use notepad when remoted into a server. It is the biggest pile of crap and having something even halfway competent included in a very expensive operating system would be a baseline I could accept.
- smegsicle 4y ago> excoriated look at that- with so many wonderful words to chose from, why do people fall back on 'decimated' ?
- pessimizer 4y agoTo excoriate means to condemn. to decimate means to heavily damage. They are not synonyms.
- z9znz 4y agoFunny that this essay about efficiency (and slowness related to lack of efficiency) is served from a Wordpress blog :).
- Jtsummers 4y agoIt still loads faster than Calculator on Windows does for me.
- frithsun 4y agoModern software is so slow because objects, by definition, are post-paradigmatic. Every program is, in essence, an exercise in metaprogramming that can't be reliably optimized, built upon, or chained together with other objects. And then you have hundreds of failed attempts to solve that problem which don't actually strike at the root problem, further making a mess of the computing environment so that it requires multiple gigabytes of resident memory to write and execute "hello world."
- twic 4y agoIn Spring you can just use the @Paradigmatic annotation to solve this.
- becurious 4y agoScanning for id3 tags at the end of files in case they’re mp3? Except doing it by scanning from the start rather than seeking from the end?
- klabb3 4y agoAlternative hypothesis: (brace yourselves) people don't care enough. Any vendor will prioritize requirements, if performance is not in there, that CPU and memory is going to be used if in any way it helps the developers. Conversely, by looking at a system you can infer its requirements. For commercial airplanes it may be safety first, ticket price second (passenger capacity, fuel efficiency) and speed third. For most software, functionality, signing up for a subscription, platform availability etc are usually prioritized higher than response times and keyboard shortcuts. Game devs worry a lot about latency and frame rates and professional software care a lot about keyboard shortcuts. This proves (anecdotally) that performance isn't unacheivable at all, but rather deprioritized. Nobody wants slow apps but it's just that developer velocity, metrics, ads etc etc are higher priorities, and that comes with a cpu and memory cost that the vendor doesn't care about.
- GregorBrandt 4y agoPerformance should be part of the requirements!
- lazide 4y ago‘Should’ doesn’t pay the rent
- mbreese 4y agoIt is... fintech normally choses good and fast (in this case fast == fast execution, not necessarily quickly delivered). That is to say -- not cheap.
- teaearlgraycold 4y agoWhen your business is in the middle of financial transactions you have the privilege of picking fast, good, and expensive.
- klabb3 4y agoI agree. I'm claiming that most customers and/or decision makers do not. We should recognize that and focus on a solution instead of blaming engineers and local technical decision making. A first step is to avoid slow products, or influence those that buy products for us.
- deleted 4y ago[deleted]
- eointierney 4y agoToo many computers and not enough scientists
- javajosh 4y agoAka "software is slow because they didn't anticipate my use-case". This person has 44k files in a scanned directory. Someone at MS was careless in configuring the scan. This would have been caught if their test harness had more files on it. FWIW I think software is slow these days because everything seems to want/need the network to function. Software is bloated for a different reason, namely the existence of a healthy, free, high quality sea of dependencies, from which we freely use.
- andrei 4y agoSomewhat relevant: https://tonsky.me/blog/disenchantment/ https://tonsky.me/blog/disenchantment/
- eternityforest 4y agoLinux on an SSD is fast. Android is fast. I don't see much slowness. Windows has a bit here and there but in general things are pretty snappy, it's not like the tail end of the HDD era where stuff really was slow.
- Valmar 4y agoMy Linux distro has never slowed down for me, except where I've personally done some weird config muckup. And I know exactly who is to blame... insert "of course I know him, he's me" meme here...
- tibbon 4y agoRecording audio clips on the iPhone 11 I have is similar. Why the heck is this thing laggier from when I press "record" than a 386 running Windows 3.11?
- userbinator 4y agoThat stack trace says it all --- the bloat known as COM rears its ugly head again. I also suspect there's a quadratic or even worse algorithm in there, hidden away amongst all that useless abstraction. The fundamental way of scanning for files with the Win32 API is an iterator (FindFirstFile/FindNextFile). It looks like they put some sort of array/indexing abstraction on top of that ("GetRowsAt", "FetchResultAt") which probably gets the N'th entry by stepping the iterator N times, and from there it's not hard to imagine someone doing for(int i = 0; i < obj->GetNumItems(); i++) doSomething(obj->GetItemAt(i));
- mianos 4y agoThis was exactly the problem with CORBA in the 90s. It made remote calls as easy to use as local calls. Once they looked the same people would make RPCs in loops like that. Imagine the cost of a non obvious RPC call in a nested for loop? Just not funny.
- mike_hearn 4y agoI think the issue is actually the sandboxing and other stuff. WinRT StorageProvider API is known to be extremely slow and NTFS / Windows IO subsystem is itself already quite slow compared to UNIX. The issue IIRC is that StorageProvider is designed for sandboxing and the way they implemented that involves doing RPCs to other processes. So there's probably some heavy context switching involved, but it's architectural, and so the voice recorder was never fixed. https://github.com/microsoft/WindowsAppSDK/issues/8 https://github.com/microsoft/WindowsAppSDK/issues/8 "The challenge here is simply that listing the StorageItems in a StorageFolder is incredibly slow and resource intensive compared to using the standard .Net/Win32 API to list the file paths. A quick test showed that in .Net it takes about 0.003ms per file, whereas with UWP StorageItems it takes about 2ms per file, which is around 700 times slower. Also, looking at the Runtime Broker, UWP uses about 70kB memory per file, which is a huge cost when loading 10,000+ files, whereas .Net uses around 0.1kB per file (that’s a very rough estimate)." Somewhere else, someone proposes a theory that due to API mismatches/design issues in Win32 the RuntimeBroker is trying to use a design that isn't a great fit in order to try and provide certain security guarantees, and this requires pre-fetching a lot of data up front in case the app requests it. But NTFS is slow, so, all this additional traffic makes opening files via the Storage API really really slow. The problem here isn't really "modern software", it's that Microsoft wrote a lot of new APIs over time with the intention of replacing Win32 (UWP/WinRT) but they aren't dogfooding them all that effectively, and they're using C++ for everything, so there are problems that don't get fixed for years.
- AlbertCory 4y agoSpeaking of Windows: the software gets slower faster than the hardware gets faster. In around 1990, I gave my dad my old 286 machine, with Win 3.1. He never upgraded it. About 2000, when I was accustomed to much newer software & hardware, I used his old machine. I was amazed how much faster everything was.
- orionblastar 4y agoThis is why some people want to still use DOS and Win 3.1 because it is faster. I run Win95 and Win2000Pro in a virtal machine with old software and it runs faster than the most recent versions. I put Ubuntu on a Lenovo PC and it runs faster than Windows 10 did.
- ThunderSizzle 4y agoI switched to Linux Mint as my daily driver and I'm amazed by its overall performance. There's still a couple quirks, but Windows 10 had its fair number of quirks too...
- zenith035 4y agoI have almost 15 year old CPU with 2 GB RAM and Intel Core 2 Duo processor. It has Windows 7 installed. I recently opened it again and was amazed to see that it actually works and it is also very snappy by current standards.
- npteljes 4y agoI had the same experience with a 900 Mhz Pentium III machine, and Windows XP SP3. It was lightning, blazing fast. It geniunely felt like the reactions for my mouse clicks were faster than I could finish the clicking motion.
- nyanpasu64 4y agoMy Core 2 Duo Merom laptop was sadly unbearably sluggish on Windows 7 with a mechanical drive even with indexing and background services disabled, even at browsing files and such (and merely laggy with a SSHD mechanical drive with flash cache), though I hear Penryn CPUs are faster (and perhaps desktops are faster than laptops). The computer performs much better on a non-JS-based Linux DE like MATE (as opposed to GNOME Shell and plasmashell), though taskbar window previews are black (probably it doesn't work on an anemic GMA 965). I swear Xfce on a 2-core Ivy Bridge laptop with iGPU and SATA SSD, feels just as fast as KDE on a 6-core Zen 3 desktop with non-Nvidia GPU, at file management, Konsole, Telegram/nheko chatting, and PDF reading, until you open a browser or Electron app or run a modern optimizing compiler. Oddly, with Windows 7 on the Core 2 Duo, the taskbar would randomly stop updating (I think it stopped happening after moving the same hard drive into a newer laptop?), and I got no end of driver issues: the touchpad would stop responding on the lock screen or logged in after sleep-wake, and audio would randomly stop playing until I restarted audiodg.exe. As far as I can remember, none of these issues happen on my Ivy Bridge laptop, where I'm clinging for life onto Windows 7 (the last version with a soul) for as long as I can keep apps running... though I'm getting rather tired of Tailscale creating a new network adapter and asking for home/work/public on every reboot.
- chris_wot 4y agoOn an open sourced application, I could submit this as a bug in a bug tracker. Does Microsoft Connect still exist for everyone?
- commandlinefan 4y agoIt’s slow because nobody cares enough to make it fast.
- gumby 4y agoI think this is an obligatory read for anyone who caused performance problems like this, especially with commonly used utilities (like the discussion of Notepad in these comments): https://www.folklore.org/StoryView.py?story=Saving_Lives.txt https://www.folklore.org/StoryView.py?story=Saving_Lives.txt
- sowbug 4y agoAs much a schadenfreude opportunity as I want this to be, I must admit my Linux desktop takes so long to launch a snap that I have time to ps and see whether it crashed or is just slow. (It's always just slow.)
- bakugo 4y agoI just tried opening the Voice Recorder on Windows 11 and was met with this: https://i.imgur.com/K8FViqO.png https://i.imgur.com/K8FViqO.png I honestly have no words for this. I can't decide if I should laugh or cry.
- akomtu 4y agoAnd to tell us this you're using imgur that loads JS garbage from 10 domains in order to display a small picture.
- meep0l 4y agoWhat do you recommend instead?
- code_duck 4y agoIn a pinch, I make a post to a reddit profile and then link direct to the image. Unlike Imgur, that does link directly to the single file and not a page with html/js.
- DivineBicycle 4y agoI use ImgBB, they're probably stealing your images but did screenshots like this is doesn't matter.
- DivineBicycle 4y agoI use ImgBB, they are probably stealing your images and not deleting them if you set it to auto delete but for screenshots like this it probably doesn't matter.
- code_duck 4y agoMaybe to one of the full pages. This link, direct to a png, only loads JS from the imgur.com domain.
- FreeFull 4y ago
- bob1029 4y agoThe actual capabilities of a modern AMD or Intel x86 chip are staggering compared to the zombie-like procession of application experiences they are forced to support every day. In the 90s, we had shooters running at playable frame rates using software rasterization on a single thread. Now from this vantage point, think about the "what if you had a 1000x faster CPU" thought experiment that was posted to HN recently. Except, make it more like 100,000x faster... If we had taken SIMD a bit further on the CPU and kept our extremely scrappy software engineering practices, I think it's possible the GPU might not have ever really emerged as a major consumer product. Recent game engine tech, such as Nanite's software rasterizer, is starting to shift ideologies back the other way now too.
- klysm 4y ago> it's possible the GPU might not have ever really emerged as a major consumer product I’m really skeptical about this take, the gains from the GPU architecture are too large to pass up on
- _the_inflator 4y agoParent poster seems to be from Intel. They argued very similar about specialized CPUs back then. "You only need one chip" Then came 3dfx, which was a blast. You can even call the Amiga Blitter as one of the first GPUs, at least a specialized graphics chip. Same goes for coprocessors, like a math unit in a 486DX for example.
- scaredginger 4y agoYeah, especially considering Quake 3D was the killer GPU app
- mattnewport 4y agoNanite is a software rasterizer running as a compute shader on the GPU though, it still requires the power of a GPU but takes advantage of the increased flexibility of modern GPUs.
- TheAceOfHearts 4y agoConsider: if I'm a bad programmers and I care about slow software but I don't know enough to make it fast, how do I go about learning? This is something I've considered a bit since listening to some Jonathan Blow talks. When you have loose requirements which change over time, limited time, and you're left figuring stuff out on your own it's difficult to do an outstanding job. Nobody taught me how to write fast software. At best I learned enough to get stuff working. Usually after I've built something slow but functional I might've learned enough to write a faster version, but there's no time to do another rewrite because the features are changing. For many developers the choice isn't between fast and slow, it's probably between slow or nothing at all. Although I do think that big tech companies should be held to slightly higher standards.
- armchairhacker 4y agoThe #1 rule of optimization is that it's only 10% or 1% of the code which matters. You only need to optimize the code which runs 1000 times a second, the code which runs 1 time every 10 seconds in a background thread can be inefficient and nobody will notice or care. You don't need to rewrite your entire app to make it run substantially faster, you only need to rewrite the hot-paths. Another key rule is to limit the "main loop" to as little as possible: don't run big computations which don't affect what the user is focusing on. For example, web browsers will pause and unload tabs when you have several of them: this means you can have over 100 open tabs and your web browser will still run fast, because the unopened tabs are not doing anything, they are just caching the URL and (in some cases) whatever is rendered on the site. Similarly, most games try not to render or update things outside of the player's vision. You don't have to go to extremes like this, but if something doesn't affect the user's flow (e.g. an extra feature only a few people use), its performance impact should be negligible. Specifically: don't put code in your hot-path that doesn't need to be there. Another key rule is to use well-written libraries for your algorithms. I assure you a vector-math library with 1000 stars implements vector-math operations much faster than you can, and those operations are neatly wrapped in easy-to-use functions. When you have code in your hot-path which needs to be there, is too slow and you can't replace it with a library, then you bring out the big-O and zero-allocation techniques. And also, caching. A lot of optimization is ultimately caching, as computation is generally much more expensive than memory. Those super pretty render engines all use a ton of caching. You can have a piece of software with tons of bloat, extra features, inefficient/redundant computations, and an Electron back-end, which is still fast (example: VSCode). Even the Linux kernel has a lot of bloat in the form of various drivers, but it does not affect the main runtime as these drivers are not loaded. Even graphically-intensive games and simulations have redundant computations and excess allocations, they are just not in the hot-path. And last tip: don't write exponential-time algorithms. The above doesn't apply when you have an exponential-time algorithm, because even when n = 30 it will slow your computer, and when n = 75 it will run past the sun burns out.
- jeffmcmahan 4y agoWhy is modern software slow? Because Joe developer's solution to a given problem is to Google up a package that solves the problem, check the license, and then run: > { packageMgr } install { randomPkg } Developer Andy, author of { randomPkg }, does the same thing. And so on, ad infinitum. You want to sum two numbers? > npm install node-plus And the source code will be: import { readFile } from 'node:fs/promise' import { dirname, join } from 'node:path' import additionChecker from 'add-check' // redundant useless comments return function(n1, n2) { // redundant useless comments n1 + n2 }
- Tomis02 4y agoYou guys check the license?
- Dylan16807 4y agoThat kind of thing won't make a program significantly slower other than a second or two to load, and won't make compiled programs slower at all.
- jeffmcmahan 4y agoNo no you're so right. Let's have 500 packages installed to do multiplication. Zero performance impact, I'm sure.
- Dylan16807 4y agoYou seem sarcastic, but you're saying something very true. The number of packages installed should have basically zero impact on performance. What matters is how much code the program runs, and the only extra code you added was import statements. That won't do much in many situations, and in compiled code it will have zero performance impact. The compile will take longer but you're not even the one that has to compile it.
- kevingadd 4y agoDylan is correct. The impact of the packages will be disk space and perhaps startup time, but that's it. The add function gets inlined in basically any runtime environment or compiler, even at O0 most likely.
- deleted 4y ago[deleted]
- kenjackson 4y agoI’ve probably fallen into this trap. Several years ago I had to have offline voice recognition and I used some library I found online for the iPhone. It worked perfectly from a functionality perspective. But I have no idea how it worked except it was based on some CMU code. I simply didnt have the energy nor desire to audit its performance. It performed well enough.
- rayiner 4y agoI’m profoundly disappointed in the direction computing has gone in the last decade. It’s like Idiocracy actually happened and we’re living in that timeline. Desktop software is trash. Apps that worked perfectly well a decade ago on far slower computers run like ass on far faster computers. The new Mac Outlook sucks CPU just sitting there doing nothing. The new Acrobat is so bad I’ve gone back to emacs for reading and annotating PDFs. To be clear, viewing PDFs in Emacs is a total hack. It involves rendering each page to a PNG file in a separate process, and having Emacs display the PNG. And it still causes the fans on my laptop to spin up less than Acrobat. And don’t even get me started on all the pdf.js/Electron stuff. What on earth is going on in the computing industry? Did all the smart nerds get siphoned off to hedge funds and machine learning, so Microsoft and Google can only hire the dregs to write boring desktop software?
- nyanpasu64 4y agoHave you tried using Okular? It's a pretty serviceable PDF reader on Linux, and now has a Windows port as well. Okular also comes with a per-page cropping mode, though it tends to cause issues when scrolling between pages. I prefer to use pdf-crop-margins (and on encrypted PDFs, qpdf --decrypt so pdf-crop-margins can read them) to generate a pre-cropped PDF that works on any reader, but keep the original PDF around for when I like it better. Another trick is that on large 32+ inch screens, you can use Firefox's pdf.js in horizontal scrolling view to hold 2-3 pages on-screen simultaneously and cross-reference them easily, then switch to the hand tool for easy continuous scrolling.
- rayiner 4y agoI was more making a comparison between PDF apps with newfangled UIs (Acrobat, anything based on Electron or PDF.js), and a complete hack in Emacs that somehow still works better. There are, of course, decent PDF apps built on 1980s/1990s UI technology. Sumatra (Win32) and Preview (directly descended from the Preview app in NeXT Step).
- spaetzleesser 4y agoI started in the industry in the 90s. Back then most devs were actually interested in computing and motivated to learn. And management was pretty loose. In my first job they basically told "Here is the problem. Come back in a few months.". No standups, no backlog. But I sat in a nice office with two other guys where we could talk about the problems. Nowadays I feel there are a lot of people who got into computing as a career but don't really care. And management is trying to convert software development into a micromanaged sweatshop with easily replaceable people.
- didip 4y agoSoftware is like water, it will always fill up the hardware that contains it.
- akomtu 4y agoThere is no money in making software fast, but there is a lot of money/promos in shipping garbage quickly. If it was the opposite, software shops would run their half baked garbage on slow VMs, and block releases until it runs fast enough, nobody at the shop would benefit from this.
- modzu 4y ago
- sbf501 4y agoIt is slow because programming is like playing the guitar: anyone can do it, but not everyone SHOULD do it.
- marrvelous 4y agoReading this made me miss BeOS. Blazingly fast UI. Mandatory to use separate threads for app rendering and processing user input to stay responsive under load. File system was implemented as queryable database with arbitrary metadata, so scanning for media was almost instant. Built in components for text rendering, media playback, etc, all had extremely performant implementation. I remember easily playing half a dozen video files simultaneously, butter smooth, with the system still being instantly responsive as if it was doing nothing. On a 200mhz 603e. Those were the good old days.
- travisgriggs 4y agoI read this and failed to find an answer to the rhetorical title. I got a lot of why "a particular operation on a particular operating system compounded to create a very suboptimal scenario." But there was no redux tl;dr that basically gave me a unified field theory about why modern software is slow. I agree that it often is, but this didn't further the fundamental praxis about why it often happens. Just ranted about a symptom. Did I miss a gem buried in there?
- calo_star 4y agoFor those familiar with UWP, what does RuntimeBroker.exe do exactly?
- ripley12 4y agoIt's part of the UWP sandboxing system ("AppContainer"). UWP apps chat with the Runtime Broker for potentially insecure operations like opening the common file open dialog or printing. There's a bit more info about it on page 709 of Windows Internals 7th Edition (Part 1).
- LAC-Tech 4y agoI'll take it back a bit further, as someone who used voice recorder back in windows 98: Why does a voice recorder program need to list files? That's what a file browser is for.
- wingerlang 4y agoIt says in the article that it finds, and lists, previous recordings. I think it makes complete sense.
- LAC-Tech 4y agoI guess I'm just getting old. I don't need a voice recorder to find and list previous recordings. I need it to record voices. Quickly. Inside one process.
- darkwater 4y agoI guess you are too file-oriented. If you were more task-oriented, it would be completely fine to use the voice recorder to find and listen the old voice recordings. Just like you would do if you had a physical device which can record and playback older records.
- peter_retief 4y agoIs this not just a Microsoft problem? Microsoft and bloatware is a synonym in the annuals of computer commentary.
- jbverschoor 4y agoIn other words, developer has no idea what the hell he’s making. He’s just implementing features, and doesn't think about anything or gives any damn. It's the reason for Steve Job's tyranny back in the day imo.
- dusted 4y agoThis kind of idiocracy reminds me of the GTA json thing.. It's kind of hard to attribute these things to ignorance, but there's been a notable shift in perception among developers.. It used to always be about "tricking" the result out of the computer by applying deep understanding of both system and problem to find the fewest, most performant steps required to yield the result. 30 years ago, nobody in their right mind would have thought "du'h, I'll just recursively scan whatever directory THIS environment variable points at and then apply whatever this library does to each file in it to get some list and then extract the files I need from that list".. Even IF you had to do such a terrible and expensive operation, you'd at least have the good sense to save your result so that you can do it more efficiently the next time..
- terminalcommand 4y agoAlternative opinion here, 30 years ago games/software were much simpler. I assume we did not have conglomerates like Rockstar and EA who pushed their employees beyond their limits. Game industry is notoriously known for exploiting programmers. Imagine being a SWE working 12+ hours a day 6 days a week getting no rest. I might have accidentally coded something like this so that I could go home a couple of hours earlier.
- eru 4y ago> Game industry is notoriously known for exploiting programmers. I'd be wary with these kinds of words. The thing is that people seem really, really eager to work in the video games industry. (Just like people are really eager to be artists or musicians or pet vets or teachers etc.) Approximately everyone who programs for the game industry could also land a cushy job writing boring CRUD software. I do admit that it's tempting to show compassion for people who put up with crappy working conditions and low pay in order to work in their beloved field. (Especially if that field sounds socially desirable like teaching.) But unless you severely restrict entry to the beloved industry, conditions and pay will always be lousy compared to what similar skills could get you in an unglamorous field. That's just supply and demand. > Imagine being a SWE working 12+ hours a day 6 days a week getting no rest. I might have accidentally coded something like this so that I could go home a couple of hours earlier. In the case of the game industry, more likely so that you could work on the next ticket during the eternal death march.
- ankurdhama 4y agoSo, nobody in the team questioned - "why are we loading the list of recordings on the program startup instead of giving a button to the user so that they can decide when to see the list of recordings".
- boxed 4y agoOr just do it asynchronously so it doesn't lock stuff up.
- alkonaut 4y agoThe operation is likely tested on common systems (a few files) and anyone with thousands of files is in a scenario that wasn’t tested. Second, the “antivirus law”: IO is considered free if it’s on a background thread. Never mind that it bogs down the computer.
- dvh 4y agoAudacity on my computer also starts 20s
- nathias 4y agobecause its optimized to serve ads not to be useful
- divan 4y ago> Blindly applying one explanation without a bit of investigation is the software equivalent of a cargo cult. How is this a "cargo-cult"?
- sublinear 4y agoI find it depressing that developers are so willing to blame themselves over a basic fact of life. Let's categorize performance into 4 poorly-defined groups: perfectly optimized, highly optimized, reasonably optimized, poorly optimized Everyone expects you to do the reasonable thing. I mean no disrespect, but finding examples of poor optimization does not justify elitist attitudes when most developers are just being reasonable otherwise. We all agree poorly optimized code is bad and never justified. I hope we all agree that anyone is capable of at least optimizing beyond what is reasonable. Anyone who has slaved over it knows this is not a skill to be proud of. We should all wish this aspect be automated (much of it has been). If a business case is ever made to optimize beyond what is considered reasonable, then you'll get to perform your hobby for pay. Does anyone seriously believe any products are perfect? Bonus words: To address the complaints about web dev, get familiar with the waterfall diagram in the network tab of your browser's dev tools and behold where almost all the time goes. Stop embarrassing yourself complaining about javascript. What you will typically find is slow backend responses, poorly organized backend APIs that demand a long series chain of requests to get what the page needs, huge unoptimized images, and yes ads. Blaming slow web pages on anything but the organization as a whole that produced it is naive.
- mgraczyk 4y agoAs a user of software, I don't care about how reasonable the optimization is, I care about how responsive the software is. Code that feels fast but is poorly optimized is fine. The problem is often that developers don't know how the software actually performs because they don't have proper analytics and don't do proper QA.
- sublinear 4y agoI almost agree. Poor optimization is trivial to avoid even without "proper analytics" or "proper QA". Code won't merely feel fast if it's reasonably optimized. Taking shortcuts around slow code is harder work than just never letting it be slow in the first place. Your team's level of experience may vary, hence what "reasonable" means. I'd also replace "developers don't know" with "project managers don't know", but if you work for a small business that distinction may not exist.
- synthc 4y agoI think one problem is that these days you use so many frameworks and libraries that is hard to get a good mental model of how software performs and where bottlenecks are. Another problem is that performance often given lower priority in enterprisey software development. For example, i'm currently working on a project where two componenens share data through a message bus. The architects decided that all messages on this bus have to use json with a bunch of headers. For my project, it could literally be 50x faster with very little effort if we could use a more efficient format, but it is not allowed.
- veltas 4y agoWhether you're trying to avoid premature optimisation, or just don't care, software is always as slow as it can be. You only tune it when you notice a problem. The only way to make software reliably run 'fast' is to run it on old hardware, and even then that won't catch problems like this that don't appear until a special condition is met. In this case I can believe the machines this program was tested on at MS had a lot less than 44'000 files. Should they have known to test with more files? I wouldn't have. To ensure quality, Microsoft also need to make bug reporting easy and effective. But unfortunately that's a herculean task with so many users. I'm guessing most actual bug fixes are a result of big companies with support contracts complaining. And how many of those are going to know or care about the microphone app?
- seydor 4y agoFor all the praise MS gets lately, i do think they have bloated windows and made them worse, which in turn drags everything down with it. Win7 was a great standard, quick, consistent, no bullshit. I have pretty much downloaded all the Win7 apps that i could find and use them instead of the new ones that come with win10. Photos? Better. Windows Movie maker is so much better than the new 'hidden' videos app it's not even funny. I use skype, and i wish they had stayed with their native version. Pretty much anything that uses the new UIs is consistently slow , it's like my computer is ignoring me. Sad
- tatoalo 4y agoThis is interesting, I have talked about this on my blog[1] where I have linked to Jonathan Blow's famous talk. I guess that we stopped caring about performance in software a while ago... [1]: https://apogliaghi.com/2022/09/software-midlife-crisis/ https://apogliaghi.com/2022/09/software-midlife-crisis/
- shp0ngle 4y agoThis is not hard. This particular app is slow because nobody cared. Not many people record voice on PCs anymore, and the ones they do, they use professional software. People just use phones for simple tasks. Over time, someone had the idea to add search for files, they implemented the shortest hack that worked, and they left it in, because nobody prioritized this app. Notes recording on phone is snappy and working, because people record on phones.
- clarge1120 4y agoMobile apps must be available for use within a second or two at most every time they are run. If not, we just won’t use the app. On the other hand, mobile websites can commonly take 10 seconds to become readable. So, why are apps slow? Because they don’t need to be fast unless users will not use them otherwise.
- bodge5000 4y agoI know some will take this badly as its questioning one of the core holy tennants of software engineering, but I do believe its in part down to an overly strong interpretation of the phrase "premature optimisation is the root of all evil". About a year ago, I was (sidenote, still am) looking to get a new computer. In my free time, I do game dev, so I wanted something powerful enough to give me some flexibility in that, but also weak enough that Im not making my game on a machine 10x more powerful than most people will play it on. Of course you test on other machines as well, but I believe poor optimisation should be seen as a bug, not just something to improve on. I've explained it badly, but hopefully you get what I mean. Anyway, I opened a reddit thread about this on r/gamedev, and got swamped by the old "premature optimisation..." rule. Its not the first, or last, time I've seen this happen. And of course, premature optimisation can ruin or stall a project, but refusing any and all possible optimisation steps prior to it being a problem seems really odd to me.
- michaelbuckbee 4y agoWell that's just it - if you're running into slowness that's going to effect the core of what you're building optimizing it isn't "premature". If you're fiddling with getting a rarely used subsystem to load in 50ms instead of 60ms that's premature.
- gigaflop 4y agoWould it make more sense for you to build a high-end PC, and artificially limit the performance when testing the game? Or keep some of your old components, to build a low-end testing machine?
- bodge5000 4y agoBoth of those things are absolutely possible, the problem is that it separates the dev and testing steps. Its difficult to explain why exactly this is a problem, so I'll give an example. Imagine your developing a game on your high end PC, you run it and it runs at like 10 fps. Clearly something is wrong, thats a bug that needs to be fixed before you do anything else. Now imagine it runs fine on your high end PC, but in testing, it runs at 10 fps. The issues are the same, and should be treated the same, but in reality they rarely are. The testing issue would certainly be addressed, but not quite with the same urgency.
- Dave3of5 4y agoFor big companies (like microsoft) software is ultimately controlled by the product teams. They prioritise the work that is to be done not the dev teams. Think of SCRUM for example the priority of the backlog is PO's responsibility not the devs. Software is slow because it's not devs who make it all by themselves it's now a team and often team members are ambivalent or ignorant of performance. Requirements come first then perf later when often requirements and perf are the same. Example you can't have a page that shows 100 million pieces of data (a requirement) and be fast. You have to pagination, lazy load ...etc. Those are requirements just as much as the fact you are showing 100 million bits of data. Good teams have non-tech people that understand this. Bad teams (most teams tbh) don't and so insane slow shit gets put out to customers.
- bArray 4y agoI find many apps on both Linux and Windows are slowed down by disk operations. You may say "get an SSD then". Well, not all your users will have an SSD, and if they already have one, then what? You could maybe offload some stuff into RAM, but many users have just 8GB, and you're not the only thing using it. If you write a voice recorder for example, you _already_ know that the first thing you will do is scan the directories. Do this during start-up, let the user know that the system is initializing and then for the most part you only need to check your assertions are still true just before recording. In general I think we need to make people care about performance more. The only thing I can think of is to make running on low-end hardware part of the validation process.