15 ms·
Alternatively, this could be titled "do you know how much your computer could do in a second but isn't because of bad design choices, overengineered bloated sys
by userbinator 10y ago
Alternatively, this could be titled "do you know how much your computer could do in a second but isn't because of bad design choices, overengineered bloated systems, and dogmatic adherence to the 'premature optimisation' myth?"
Computers are fast, but not if all that speed is wasted.
A recent related article: https://news.ycombinator.com/item?id=13940014 https://news.ycombinator.com/item?id=13940014
- agumonkey 10y agoThe market is wasteful. Lots of things are subpar because of the competition requiring adhoc solutions pushed to market, then becoming standard, so on and so forth. You can blame the game or not. At least if there was some acknowledgement of that process and a little cleanup time to spread good ideas and good fix ... Personally I always feel weird booting up old boxes (say old = Pentium 2) and realizing how much the whole platform could do. It also felt quite sufficient in terms of UX and presentation. That's odd because, everybody (I assume) feels how quickly we feel our newest gear gets slow, and how a new generation improves speed. But when I pop a very old system I don't feel slowed down much. It's just of a lesser resolution (hi res images, sound, videos); which for my needs doesn't really matter.
- gizmo 10y agoAn eye-opening experience is running an IDE like Visual Studio 6 or a really old version of Photoshop on a modern machine. It starts instantly, compile times are a fraction of what we're used to. The interface is totally responsive. It's remarkable how much better software feels when everything is instant.
- userbinator 10y agoDeveloper tools like Visual Studio are somewhat ironic in that the developers who create inefficient software are essentially seeing this reflected indirectly in their tools also becoming inefficient. A perverse version of "do unto others as you would have them do unto you"?
- agumonkey 10y agoI used to think that of the java world. It wasn't above some critical mass / threshold of simplicity, and everybody that liked java lacked that simplicity, and every solutions they tried to add to java just added more cruft (xml, j2ee beans, IDEs)
- logicallee 10y ago>An eye-opening experience is running an IDE like Visual Studio 6 or a really old version of Photoshop on a modern machine. It starts instantly, compile times are a fraction of what we're used to. The interface is totally responsive. If you gave that to a Product Manager candidate (as part of an interview) and pretended it's your current product (assume they didn't know it already), asked them to play around with it for ten minutes and as their task come up with some thoughts regarding what they would add or improve, their eyes would pop open and they would say, "WOWWW!! THIS LOOKS LIKE IT ISN'T DOING ANYTHING -- THERE IS A LOT OF ROOM FOR IMPROVEMENT HERE." And in just fifteen minutes, they would gleefully tell you exactly how they would break it. (By adding crap to make it slow.) (Note: this could be run as a real experiment, but the results above are my personal prediction - maybe it wouldn't happen as I predict.) I really do think product managers are the people to blame here. To them, fast = broken or not doing anything. It's not done (to them) until it's (to us) broken.
- tedunangst 10y agoOr start with the current version, then demo the ancient version, and claim you've "streamlined and tuned" the program?
- logicallee 10y agoWhat I was getting at is that the suggestions to add crap would come from the product manager candidate themselves - thereby "proving" (if the results match my prediction) that the requirement for slow unresponsive interfaces come directly from the PM's, who would add it if it weren't already slow. Like, I want the experiment to test if a product isn't already slow, would a product manager actively make it slow? (I think, "yes".)
- gizmo 10y agoWhen software is too slow it hurts sales. When software lacks features that hurts sales too. Faster doesn't make for compelling marketing (anybody can claim their software is fast) but you can get people to upgrade for new features. So features are added with every release and performance improvements are made up so to the point where it's "good enough" again. You don't need a product manager conspiracy to explain why software is bloated and slow.
- bcook 10y agoSimilarly, I run a very barebones Openbox Arch Linux install on my ancient 2Ghz Turion 64 laptop and I recently booted Windows XP on it and I was blown away by how fluid & responsive the entire system was compared to my much newer Linux-based OS.
- em3rgent0rdr 10y agoIt's remarkable how much better software feels when the software was developed on a slow machine. Unfortunately devs invest in the fastest equiplent, so they don't experience how their code runs on the average end user who doesn't upgrade every couple years. In can be useful to test your code in a VM that is deliberately slowed down, so can get a feel for user experience on a slower machine. Then you'll know what parts need to be optimized.
- megablast 10y agoUnfortunately devs aren't given any time to optimise it to run on slow machines. It is not a priority.
- ryukafalz 10y agoYou don't necessarily need to specifically optimize for it: just do your development on a slower machine. If you're using a compiled language, you can offload compilation with something like distcc for productivity's sake, but all your testing should be on the slow machine. It'll be pretty clear if some change you've made is going to impact people on older hardware, because you'll notice the moment you make the change. And if it's unbearably slow for you, it will be for a good chunk of your users as well.
- Gracana 10y ago> Unfortunately devs invest in the fastest equiplent, so they don't experience how their code runs on the average end user who doesn't upgrade every couple years. As someone who doesn't spend much on computer upgrades, I notice this everywhere. Especially when it comes to web development, where everything is optimized for chrome on mac. Don't have a laptop made in the last year? Enjoy a janky-scrolling slow-loading hard-to-read mess.
- snackai 10y agoAlso, the web devs have no idea how slow the connections in even the western world can be. At least I think so, if they had to experience a 4 Mbit/s connection more often they wouldn't push for Angular and such.
- mwcampbell 10y agoSo is there any way to stop this treadmill, short of overthrowing capitalism itself? Edit: If that seems like a non-sequitur, I said it because the parent comment started by saying that the market is wasteful.
- gizmo 10y agoThere is certainly a case to be made for overthrowing capitalism, but I don't see why an anti-capitalist revolution would automatically result in a society with higher quality software. Open source software suffers from much the same problems as commercial software. There is much about writing good software we haven't figured out how to do yet as an industry, and in the meantime we have to work with tools that are totally inadequate.
- mwcampbell 10y agoWhy do you think our tools are inadequate? What would adequate tools be able to do that our current ones can't?
- gizmo 10y agoWay too much to cover in depth. In short, it's all terrible. We're mostly using tools from the 70s, and we're still to this day plagued by use-after-free and out-of-bounds errors, nullpointer exceptions, awful debuggers, race conditions, slow compilation times, bad primitives for multithreaded work, just to name a few. We've known for decades that we can do better and ways to do better have been studied in depth by academia. That's just the basics. Then there is futuristic things: Why can't we move running processes from one physical machine to another? Where are the debuggers that allow you to go back and forward in time? Why can't we visualize the data structures in our program and trivially change the data layout to see how that affects performance? When I look at the demo of the Xerox Sparc interface (1982) and compare that to where we are today it's pretty clear to me we messed up big time somewhere along the road: https://www.youtube.com/watch?v=Cn4vC80Pv6Q https://www.youtube.com/watch?v=Cn4vC80Pv6Q
- icantdrive55 10y agoThis will sound pathetic, and it's partially because I don't have much of a life, and spend way too much time with electronics, but one of my biggest regrets is--- Upgrading. I've always fell for the increased security, and blah, blah, blah, but in the end I have a device, I once used, become slow, programs become useless, or my plethora of USB devises don't have the right updated firmware. I have a Mac, and a MacBook Pro I'm thinking about wiping clean, and installing the original operating systems. It's just a pain, and yes--I know security is important. I did finally learn on the IPad, but I'm still not completely sure I'm doing the right thing. I must have hit "tomorrow for 9.3.5---three hundred times. I just don't want to make this devise slower. I paid way too much years ago, and I hate putting things in my electronic graveyard--my closet.
- angry_octet 10y agoI can't upvote your most recent comment because you're attracted too many haters too quickly and the comment is in purgatory unjustly. In fact, I think you've attracted some regular haters, though I can't prove it. I suspect someone doesn't like your anecdotal style, but it is just as valid as an unsupported generalisation.
- mwcampbell 10y agoOn further consideration, though it's common to talk about an upgrade treadmill or "what Andy giveth, Bill taketh away", software actually does get better over time, and we shouldn't look back so fondly on older versions. To pick just one example, software in the 90s didn't have inline spell checking as you type, a feature that came in handy for me just a few minutes ago while editing my other comment. Still, the question remains: why doesn't everything feel instant on our current systems, and what do we do about it?
- MagnumOpus 10y ago> To pick just one example, software in the 90s didn't have inline spell checking To pick on your example - it is interesting that you have to go back 20 years to find a feature beneficial for the everyman, and that you are still wrong: Just about every word processor starting from MS Word 95 came with inline spell checkers. (And indeed I prefer the snappiness and identical feature set of my copy of Office 2003 to the ribbon-laden gigabyte-guzzling mostrosities of Office 201x, just as I prefer a 15-year-old Winamp to the latest Itunes player.)
- klibertp 10y ago> To pick just one example, software in the 90s didn't have inline spell checking as you type What? Which 90s exactly did you live through? Because I seem to remember MS Word 6.0 having not just spell checking as you type, but also the dreaded autocorrection feature. That was in 1993 according to Wikipedia.
- dahart 10y agoTo be fair, that article is discussing a small bug, not over engineering or dogma. The size of the deal people made over it was more wasteful than the CPU time this (now fixed) bug cost. And FWIW, of all the problems that matter to me and my teams, I find premature optimization to be far, far more wasteful of money and human energy than wasted CPU cycles. There are definitely times to worry about performance, and I fancy myself a deeply performance oriented person, and yet I am and will continue to be proud of my dogmatic adherence to avoiding premature optimization, because in my experience it's not a myth at all. I have watched literally years and millions of dollars wasted multiple times by teams that decided to prematurely engineer high performance solutions to problem they thought they had but didn't actually. So I'm way more scared of premature optimization than I am of wasting cycles.
- devwastaken 10y ago>I find premature optimization to be far, far more wasteful of money and human energy than wasted CPU cycles. I would argue this always depends upon what you're doing. For example, in webdev, the culture of prototype fast and break things fast is very abundant, and makes sense when you're just trying to figure out if what you want done is even possible. However, there are many times where you /do/ have to consider the performance impact, because with it, what you're making isn't going to be nice to use. By dogmatic, I think they meant individuals who will actually argue that '100ms' loop times are 'tiny' and shouldn't be a problem. They don't get the concept that its just one small part of your code, and the rest of it combined can make an entire process take up to 5-10 seconds to do something that should be in a blink or two. Learning about optimization is a part of learning programming, and knowing when to use it. The problem is when you don't know it, and fumble around trying to do so when you've got much bigger problems further ahead. I ran into this problem a lot with image filtering and working with Canvas's to build an image editor. I talked with some communities about the Uint32Array implimentation in chrome and other browsers and how some of the ES6 goodies, like 'let', are actually bad practice when you start to get into image filtering, because just iterating over all the pixels in an image by using "for(let i=0;i< pixel.length;i++){}" is 3x slower than using var, causing just a single full loop to be 80-120ms on a good computer. TypeScript compiles down to var, though, so its less of a problem there, but I met a lot of resistance in that statement in general, even though its true, because there's a lot of dogmatism in programming. At the end of the day I'd rather learn and teach good practices and not tell people they're pre-optimizing unless they really don't know much about what they're working with.
- Athas 10y ago> Computers are fast, but not if all that speed is wasted. While computers are fast, the performance improvements have been spread very unevenly. CPUs have improved the most, with memory lagging significantly behind, and persistent storage even more distant. On the other hand, networks have become much faster than before. I like this list of Latency Numbers Every Programmer Should Know: https://gist.github.com/jboner/2841832 https://gist.github.com/jboner/2841832
- matt4077 10y agoIs that still true? I would think that the rise of SSD means persistent storage has improved much more CPU, at least in the last decade or so.
- Athas 10y agoNot really, it's just another example of uneven performance improvements. Peak CPU performance has increased massively, but achieving it requires the use of vector instructions (and multiple cores). It is true that the speed of persistent storage has increased faster than sequential CPU performance (but it's still quite far off).
- pekk 10y agoDo you know how much you could do in a month but can't because of bad design choices, overengineered type systems, and dogmatic adherence to the 'every application needs to be written in the language with the best benchmark numbers' myth?
- mwcampbell 10y agoFalse dichotomy. The real solution is a language with a strong, static type system (and thus plenty of room for ahead-of-time optimization) that's also concise and productive, such as Kotlin or Swift.
- sametmax 10y agoIt's wasted only if it's not traded for something else. But it is. A lot of system would simply not exist if we would have waited for people doing it properly because there is a limited pool of very skilled experts and the demand for IT far exceed our ability to supply. Plus writing good code takes a lot of time and resources, but our society changes now so fast that it very well maybe rewritten next year. Hence, we are trading computer power to compensate our limited human resource. E.G: wondering why you see electron apps everywhere now ? Because until now making a beautiful, powerful and modern app with a portable GUI was something only a few people would be able to do. Now any web dev can do it, and they are able to solve problems that weren't solved before because nobody would be available to do it. At the price of performance, memory usage and the use of the ugliest programming language we ever made popular. It's the same deal as before. When C arrived, Wordperfect died because they stick to assembly. For them, C was wasting resources. When Java arrived, expert systems were turned to it because it was more productive than to write it in C. We didn't need it to be fast, but the companies wanted their tools to be produced quickly. Then when the Web arrived, people were laughing about the quality of PHP (initially a Perl hack !). So many bad code, so many security fails, just a terrible, terrible stack of programming debt. But it created the web we have today because it was easy to use, and suddenly a lot of people could just write their web forum. Hell, I learned my job with EasyPhp.exe way before becoming a Python expert. Nothing here is wasted. It's just implicitly and involuntarily invested.
- aschampion 10y ago> Because until now making a beautiful, powerful and modern app with a portable GUI was something only a few people would be able to do. Except it's none of these things: electron apps suffer the same presentation-before-content problems as most of the web, they inherit all of the state bugs of web apps, and they're painfully slow despite usually just being menus of nested lists and text boxes. It's passing a burden from developers to users, which considering the huge asymmetry between these two groups that's typical (at least 3 orders of magnitude, and often 6 or more) is an enormous inefficiency. I'm all for selecting tools and platforms to better optimize developer productivity, but it's not clear to me the web platform has actually accomplished that for all but a few types of applications, and pushing it to the desktop is resulting in cumbersome, unresponsive, needlessly fragmented interfaces. Put simply: Amazon Music Desktop has untold development investment and a complete visual redesign every 6 months, but WinAmp circa 2001 is somehow a thoroughly better way of searching and playing music.
- seanp2k2 10y agoOr it can blink a cursor https://news.ycombinator.com/item?id=13940014 https://news.ycombinator.com/item?id=13940014 I remember an early Atom extension which faded the cursor in and out. It used 100% of one core to accomplish this.
- jackmott 10y agowell most of the examples are in interpreted python which would be one of those bad design choices.
- DonaldFisk 10y agoThat's Wirth's Law: https://en.wikipedia.org/wiki/Wirth%27s_law https://en.wikipedia.org/wiki/Wirth%27s_law How bad is the problem? https://hubpages.com/technology/_86_Mac_Plus_Vs_07_AMD_DualCore_You_Wont_Believe_Who_Wins https://hubpages.com/technology/_86_Mac_Plus_Vs_07_AMD_DualC...
- ska 10y agoYou're nearly right: but premature optimization is no myth, but a massive source of both bugs and wasted effort. The backlash (e.g. your statement?) against it's misapplication seems to be causing as many problems today as the misapplication, at least in my experience. It is true that "premature optimization" is used as an (invalid) excuse for lack of or poor design, but if wasn't there another excuse would be found. That's not what Knuth was talking about.
- deleted 10y ago[deleted]
- woliveirajr 10y agoThat made me remember when I was learning to program (Clipper anyone?). How fast Clipper (compiled) was when comparing to dBase III PLus. And made me wonder: for small applications, like the traditional one computer that controls my sales, nothing online... which language would I use? Seems that there are many options for big systems, buj WebServer + Java + (...) seems to be too complex (and slow) for small needs.