15 ms·
It is fast or it is wrong
- PaulHoule 8y agoHe's got some good points but it is a garbled argument. Really I don't know about JS Hell, but C++ compilers aren't slow because nobody has tried to speed them up, rather the nature of C++ is that it is slow to compile. Every so often somebody rage quits C++ and starts a language like Go because of this. The real data point is that Clojurescript is only slightly slower to execute than real Clojure, but takes two orders of magnitude more time to compile. He's right though that people have to move on past Electron. Lately I have been building applications in Python/tkinter and I still can't get over how fast it is on both my mac and PC both to start up and when running. There is none of the "spend 30 seconds watching a splash screen" that we're are accustomed to with advanced applications in Java and C++ (eg. PyCharm and Photoshop) Another thing that impresses me is the size and speed of small GUI applications written in C for Windows such as this little utility: https://docs.microsoft.com/en-us/sysinternals/downloads/diskview https://docs.microsoft.com/en-us/sysinternals/downloads/disk... I think MacOS is also part of the problem. Lately I added a new keyboard to my Mac and I thought I was having Bluetooth problems but the main reason it was unresponsive was that the spellchecking baked into the OS would cause keyboard input to lock up for a few seconds periodically. Later on I noticed that web browsers on Mac OS (Safari/Firefox/Chrome) seem to "go to lunch" and not respond to mouse clicks for 5 seconds every so often. I imagine this impacts Electron apps. I think people have been "frog boiled" into expecting computers to be slow.
- dkersten 8y ago> There is none of the "spend 30 seconds watching a splash screen" that we're are accustomed to with advanced applications in Java and C++ (eg. PyCharm and Photoshop) Are your applications of similar size and complexity as these Java and C++ applications? Photoshop is a huge beast. I ask because I’ve written C++ GUI applications that start up instantly (sub second). I’ve also written Python GUI applications that did not. It depends on what and how much you’re doing on startup. Most GUI applications aren’t as large as PyCharm or Photoshop and start up significantly faster, regardless of implementation language. > Later on I noticed that web browsers on Mac OS (Safari/Firefox/Chrome) seem to "go to lunch" and not respond to mouse clicks for 5 seconds every so often. I’ve not had this problem personally, but I have had Chrome lock up my entire system on Ubuntu (input including mouse clicks simply not doing anything, but if I happen to have another window open I can alt tab to that and then everything is good again, or at least I can kill Chrome).
- PaulHoule 8y agoI've made smaller apps with JavaFX which still take annoyingly long to start up compared w/ similar tkinter apps.
- dkersten 8y agoJava was once notoriously slow and still has slower JVM startup time than C++. Maybe JavaFX is slower. I’ve not written any GUI applications in java nor do I use many java applications. However, my experience with C++ has been very different: things can run and start very fast. If they don’t, it’s because either you did something very wrong or because it’s doing a lot of work that would be equally slow elsewhere. I’ve used Qt, WxWidgets, FLTK, GTK+ and a FOX as my GUI toolkit over the years and, for my small applications, all of those start so fast I don’t notice it. The only slowdown I’ve noticed is with Qt when using QtQuick (I assume because it has to load, parse and then execute QML — essentially JavaScript — as well as the C++ code). It’s still faster starting up than PyCharm and Photoshop for anything that I’ve used it for.
- hyperman1 8y agoIve always wondered why java starts so slow. A simple hello world takes a second or so. Most interpreted languages do a lot better. Once it has warmed up, it's close to C however.
- kkarakk 8y ago>Once it has warmed up that's the problem, a lot of workflows even on really complex applns like photoshop are firing up a project for a couple of minutes to get some output or correct something. enough time is wasted warming up that people who can afford it just leave the applications running. i just keep whatever VS project i'm working on running for eg coz the startup times are painful and i have RAM to spare
- bostik 8y ago
- madlynormal 8y ago> Lately I have been building applications in Python/tkinter and I still can't get over how fast it is on both my mac and PC both to start up and when running. Has the GUI of tkinter apps improved over the past couple of years? I have yet to see an interface built with tk that doesn’t look like it was meant for Win95.
- mantlepro 8y agoFor native looking tkinter, there's ttk (themed tkinter).
- notatcomputer68 8y agoI'm always suspicious when people say something can be done. Why isn't it the default then? Because there is some drawback to that choice. But what is it?
- kkarakk 8y agohaha, well for example there's an issue open since 2012 about how common convenience dialogs don't work with themed tkinter although i don't really understand the comments about IDLE supposedly doing it automatically but not yet?. i think tkinter is a tool you reach for coz you know python only to realize you can't really write bulletproof UI in it coz of some workaround or issue. https://bugs.python.org/issue15191 https://bugs.python.org/issue15191
- UweSchmidt 8y agoI used tkinter a few years ago, since it was available on Raspbian on the Raspberry Pi. It looked bad on Linux, and it seemed tkinter was not in active development or getting a lot of attention. I remember not having found any sane workflow for how to place GUI elements and struggled to place a bunch of text boxes and buttons. Reasonable or not, I have a hard time accepting workflows worse than what Microsoft Access or VB 6.0 had.
- jakobegger 8y agoYes, macOS is gradually becoming slow. Worst thing is the Finder. Moving files between folders used to be instant. Now it sometimes takes a few seconds for files to appear in a folder after you drop them. I have no clue why. I tell myself that the problem is that the old, experienced programmers are leaving, and inexperienced young programmers are too busy adding new features (it works! good enough!) to make sure anything actually works well. And of course that never would have happened if Steve Jobs was still alive. (Just kidding. Steve Jobs loved fancy graphics that made everything slow)
- sbr464 8y agoI’ve noticed iCloud sync is sometimes the issue. If dropping files into/around enabled folders the sync process invokes immediately and uses a lot of CPU similar to Dropbox sync.
- __blockcipher__ 8y agoDo you use google drive? I experience the same file issue on my work laptop where I can’t uninstall the drive daemon. https://piunikaweb.com/2018/03/01/google-blames-apple-for-drive-client-triggered-lags-on-mac-os-high-sierra/ https://piunikaweb.com/2018/03/01/google-blames-apple-for-dr...
- zozbot123 8y ago> I tell myself that the problem is that the old, experienced programmers are leaving, and inexperienced young programmers are too busy adding new features (it works! good enough!) to make sure anything actually works well. You joke, but this is a real issue. It's hard to find any other explanation for why the quality of commonly-used software has taken such a massive nosedive in the latest 15 years, outside the FLOSS world (CADT syndrome notwithstanding!) even as software was supposed to be "eating the world" by now! Windows Vista, anyone? (Or, as some folks in Microsoft marketing used to call it rather presciently, Windows "Mojave"?) I guess it just goes to show that, yes, systems programming still matters, as do projects that attempt to open it up to a far broader audience while keeping and even strengthening its focus on rigor, performance and correctness.
- smnplk 8y ago> I think people have been "frog boiled" into expecting computers to be slow. So much this!
- jonahx 8y agoNot only are these differences not the high-order bit of programmer time, for most applications they're probably the lowest-order bit: > So what do these numbers tell us? Basically, to process exactly the same code, you can either spend ~8 seconds, 24 seconds or 78 seconds. Your choice. My choice is I don't care in the least about these differences, and would gladly take the 78 seconds if that slow language had slightly better syntax or was slightly more expressive. If I were working on a google scale code base and the difference was an hour vs 2 days, I might care then. But for the vast majority of programmers and applications, that's not relevant.
- whatshisface 8y agoThe blog post was mainly written about GUI toolkits, if your application was freezing for 78 seconds waiting for a screen redraw you might be willing to settle for uglier syntax.
- jonahx 8y ago> if your application was freezing for 78 seconds waiting for a screen redraw 78 seconds was the compile time. The runtimes were almost identical: 0.45 seconds to run the entire test suite in the fastest case vs 1.3 in the slowest.
- EmbarrassedFuel 8y agoThe slowest is three times slower than the fastest! That’s not almost identical at all, and could easily be the difference between a useable interface and an unbearable one...
- jonahx 8y agoIt could be. And when I have evidence that user experience is affected, I'll care about the difference. But what if it's 1ms vs 3ms? Or 3ms vs 9ms? And the 9ms time is a much more expressive, productive, high-level language? I'm not going to care about the difference just because "omg one number is 3x another number!?!"
- karmakaze 8y agoI remember when I tried Atom when it was hype, others loved it but it felt so slow compared to SublimeText and InelliJ. I wrote off Electron apps right then and there. Then VSCode came along and showed that it wasn't all Electron's fault, there's a right way to do it. With faster platforms what you get is the room to do things wrong (inefficiently) with hardly anyone noticing.
- InGodsName 8y agoMy favourite text editor is VSCode. I use sublime as a notepad. Tixati is my favourite torrent client.
- karmakaze 8y agoMe too. Sublime's always keep text even when rebooted without save makes it the ideal notepad. Don't think I run any other Electron apps. Used to run Slack and Spotify but now just pin browser tabs. Some devs run Gitkraken which baffles me.
- InGodsName 8y agoYeaaa i also used git kraken to learn but now i find it bit bulky.
- karmakaze 8y agoIt depends on the hardware and what you're doing. Admittedly I was running 10ish not-so-microservices on a dev laptop so couldn't really spare the cycles or RAM. Now on a desktop machine with 32GB and more cores I probably wouldn't notice but just don't like the idea of it from my previous experience.
- whatshisface 8y agoPart of the problem is that most of the competition has made it from the 80s or 90s unchanged. For all of its faults, the "web stack" has benefited from far more development than tk or wx. I have tried a few things and web development is the best GUI development experience by a long shot.
- skybrian 8y agoI mean, for some jobs, you could make the argument "it runs in the browser or it is wrong." But there's no point in turning something subjective into a one-bit moral requirement. Programs need to be fast enough to meet requirements and people have different opinions about what they require. There is even an argument that slower is sometimes better. The large tech companies put enormous effort into reducing latency, but I'm thinking of writing a browser extension to add latency to some websites to make them less addictive. Where you stand on this is going to depend on what you're trying to do.
- ragona 8y ago> I'm thinking of writing a browser extension to add latency to some websites to make them less addictive. Woah, that might be really effective. I love the idea of finding ways to undo the powerful conversion and retention techniques that our industry has developed. Adding latency is likely not frustrating enough that I'd just bypass it (like I do with Screen Time), but maybe it'd work for my brain. So cool. I wonder what other opportunities exist in the "making this less sticky" space.
- exel 8y ago> The large tech companies put enormous effort into reducing latency, but I'm thinking of writing a browser extension to add latency to some websites to make them less addictive. That's how javascript was invented, stop trying to do dangerous science.
- ragona 8y ago> there are two types of solutions you end up with: ones that can calculate the answer in a couple of milliseconds and the ones that would take years to finish This is of course a bit of an overstatement, but I generally agree that (depending on the language you're using, and the problem you're solving), there are quick solutions and slow ones. However, based on the videos he posted, the author seems to have stopped just before the Advent of Code problem most likely to make his CPU cry! Day 14 didn't have an obvious optimal solution, so there were quite a lot of correct solutions that took seconds, not milliseconds. (If you're curious, check out this awesome post from /u/askalski [1] on getting it to run truly fast.) Humans seem to be naturally inclined to pick the "best" option, and naturally frustrated by the fact that best changes so often depending upon the situation. In almost any situation as a programmer, you're deciding between several competing priorities. There's your speed as a programmer, your code's speed for the target hardware, your ability to get people to help you with the code, either via hires or online documentation, etc. With regards to Advent of Code (which I also completed this year, and really enjoyed!), the "right" solution in Python could often be hundreds of times slower than the right solution in C or Rust -- just check out the benchmarks for similar toy problems [2]. That doesn't mean the solution is wrong, it just means that the author has decided that a couple seconds of the CPU's time are worth the benefit of using a higher level language, which is often a reasonable choice. 1: https://www.reddit.com/r/adventofcode/comments/a6wpwa/2018_day_14_breaking_the_1_billion_recipes_per/ https://www.reddit.com/r/adventofcode/comments/a6wpwa/2018_d... 2: https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/python3-gcc.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- IshKebab 8y ago> You don’t get anything from being on JS, except a 2× performance hit and astronomical build times. Erm. How about the ability to run in a web browser? You know. The single reason Javascript is popular. Maybe that?
- Lio 8y agoI think the one thing I appreciate about running in a browser is control. A native app removes any chance to run an adblocker (I guess it might be possible at the network level) and probably means that you won't be able to add keyboard navigation as you'd get from something like Vimium. I always find it very jarring to be using something like iTunes and to realise that I can't Ctrl click something into a background tab.
- dehrmann 8y agoWith a lot of SPAs, you can't control-click have the components because someone either didn't make it an a tag or didn't make the linked page render on its own.
- heroic 8y agoThis is by far the weirdest of all arguments ever. The OP compares faster execution of code to being a comfortable aircraft and slower to an uncomfortable train. What he missed out on is, that it's easier to build out code that may execute slow, but works(making it more comfortable - room for quick changes to the product), rather than making something that takes a hell lot longer to make(and then spend proportionately longer when you have to change something) I'll take Ruby vs C as an example. If I was to test out a weekend project, I'd rather choose ruby, even if it's going to be slow, as I can focus on finishing everything in the few hours that I have
- snek 8y agoThe first half of this article made me think it was going to talk about how clever algorithms can change a 1 year problem into a 1ms problem, think outside the box, etc. Instead it took a nosedive into complaining about electron, which definitely needs to be complained about, but this felt a bit unfocused.
- apo 8y agoI would rephrase the title: "It runs on the user's platform or it is wrong." The example discussed throughout the article is Clujure vs. ClojureScript. The author takes issue with the difference in compile time (6.5 seconds vs. 78 seconds, respectively). But this really is an apples/oranges comparison. If the user expects to run the program in their browser, then any solution that doesn't deliver that experience is wrong. End of story. If the user can't be bothered to figure out how to install your native or byte code binary, then your solution is wrong. Find a way to give the user what they expect or stop trying to write software for a living. Here's a common programmer dilemma: You are familiar with development system X. However, your users demand that your software run on platform Y. Platform Y doesn't support X natively. What do you do? One option is to refuse to learn the development tools for platform Y, bringing shims, transpilers and a bunch of other dreck needed to get X running on platform Y. But the user will notice the difference and not like it. You're better off learning the native development tools for platform Y, and delivering a native experience. In other words, drop ClojureScript and write the application in JavaScript if your deployment target is the Web browser.
- Hendrikto 8y ago> You are familiar with development system X. > However, your users demand that your software run on platform Y. Platform Y doesn't support X natively. What do you do? Use Electron apparently… > One option is to refuse to learn the development tools for platform Y, bringing shims, transpilers and a bunch of other dreck needed to get X running on platform Y. > But the user will notice the difference and not like it. Exactly. I do not like it at all.
- widdershins 8y agoThe fact is that a viable, efficient, native and cross-platform GUI solution has failed to emerge. Note the word 'viable'. Those who might suggest that Qt covers that role have to explain why, even though it has been capable of fast, attractive apps for a long time, nobody built Slack, Discord, Atom or VSCode in it. This is the point about Clojurescript too: yes it compiles slower and runs slower, but it allows access to what is essentially the world's largest and most complete UI framework, known as the browser. That makes apps cheaper and faster to produce, at the cost of sluggish/bloated performance. The market has indicated that this is an acceptable tradeoff. Until some other solution can match it on these axes, Electron/Javascript/React SPAs will dominate. I work with a Qt-like C++ GUI framework (JUCE), but we've seen increasing portions of our front-end work replaced with Electron/React Native. It saddens me to see binary sizes and memory consumption balloon, because native development encourages you to care about these things. But even I cannot deny the order-of-magnitude improvements in productivity from hot-reloading, a deep (if byzantine) system for styling and layout (including text), and reuse of modular components across all platforms.
- devxpy 8y agoSpeaking of "a viable, efficient, native and cross-platform GUI solution", I have high hopes for flutter.
- dangoor 8y agoCan Flutter really be called "native", though? As I understand it, it operates like Swing: it draws all of its own widgets. They do their best to emulate the platform's widgets, but it's not using the native APIs for them.
- devxpy 8y agoYes, you are correct. I think Flutter means native in the sense that it runs at native speed, perhaps even faster in some carefully selected apps As for a look and feel thing, Flutter widgets feel alright to me..
- yholio 8y agoPut your money where your mouth is. If you think something can be improved, and the cost of that improvement is justified by it's benefits, then you have a valid business idea. More often than not, somebody with far more domain specific insight than yourself thought about the same thing, and rejected it, constrained by some other more important issue you can't yet see. That's not to say that no improvement is possible, just that you are in a global competition with millions of other smart people and moving things forward is hard and takes dedication, not just hand waving.
- TeMPOraL 8y ago> If you think something can be improved, and the cost of that improvement is justified by it's benefits, then you have a valid business idea. Stop wasting your time bashing Electron on your blog and start working on your idea, it could be the most important thing you have ever done and could make you rich and famous. To be fair, preventing a small group of people from dumping disproportionally large externalities on everyone else, to extract a little extra profit for themselves, isn't a working business model. If it was, we would have solved global warming and ocean pollution by now. Slow software in general, and Electron in particular, is a collective action problem. Solid, fast software gets outcompeted by half-assed bad engineering, because the latter can get to the market first. (Also known as the curse of "worse is better".)
- notatcomputer68 8y agoIrc has been on the market for a long long time, but slack won anyway. Maybe the extra features saved users more time then they lost from running bloated JavaScript.
- deleted 8y ago[deleted]
- pseudalopex 8y agoIRC is a protocol. Slack is a service. That's another collective action problem.
- sixstringtheory 8y agoI agree with his basic premise that if a faster solution exists, it is better, and believe that considering how many users a relatively miniscule development team will impact warrants much more inconvenience on the developers’ part to make the users’ experience better–an extra couple of days for me vs. possible man-months of lost productivity in aggregate for my users. Some of the truisms in the article rubbed me the wrong way though: > It’s not that they couldn’t build faster. They just choose not to. I’m not sure I agree and I don’t see what it’s adding to the argument. > in the end what matters is if you have a working program on your hand and if it can produce the answer in a reasonable time. It doesn’t really matter how the developer arrived there. Is this sarcasm? From my opening comments you’ll see I disagree with this. But, I originally thought the author did too. Then they go on to construct an analogy of a shitty train and an awesome plane that cost the same. Where did they get this part from? I thought the reason people chose e.g. Electron vs. native is that there is a different cost involved for the developers? > It’s easy to find excuses why things are the way they are. They are all probably valid, but they are excuses. I used to assert the opposite when I was young, to my parents: “It’s not an excuse, it’s a reason.” It’s easy to dismiss others’ arguments out of hand, but the fact is there is a reason for every decision made, even if you disagree with the reasoning. There is always room for more education. I just don’t see how we can make any headway if we ignore each other like this. This reads to me more like “I don’t understand why C++ or Rust compile slower.” > We know way faster programs are possible, and that makes everything else just plain wrong. It’s easy to fall into the right vs. wrong argument when talking about programming–binary logic, tests either pass or fail. But we’re in the human realm here, where I’m of the opinion that there is no right or wrong, only consensus. In the case of products, like Slack, consensus manifests as what the market will bear. I might not agree, but for the time being, the industry has deemed it “right.”
- conqrr 8y agoIt's exactly apples and oranges being compared here. Languages and libraries or framework overhead is nothing compared to the toll of Big oh complexity. In fact the former doesn't even get multiplied that much as your input is pretty much constant. You start your application once unlike the input to your npow3 algorithm taking in a massive dataset. Also languages can make development more productive, which again is debatable but the slowness isn't comparable to Big O complexity. I am all in for leaner and efficient languages or stacks but I can live with bloated languages as opposed to inefficient algorithms.
- alexashka 8y agoThe author's point is that he wants to live with efficient algorithms, efficient languages and tooling. It is not an either/or proposition - we can have all the things, or at least something significantly better than the current state of affairs.
- jahewson 8y ago> Electron text editors can’t resize their own window in real-time and drop frames while you just move your cursor around. VSCode has no problem doing this on my Mac. I was scrolling through a 4000000 line file the other day like butter. Win32 however can’t resize the most basic window without flickering - which is why every decent Windows app uses its own non-native GUI layer. There’s nothing wrong with non-native solutions - they’re often better. We can have the best of both words. Native on some platforms just isn’t that great.
- gdy 8y ago"Win32 however can’t resize the most basic window without flickering" That's not true
- roel_v 8y ago"Win32 however can’t resize the most basic window without flickering - which is why every decent Windows app uses its own non-native GUI layer." This is so extremely wrong it's not even funny any more. WS_CLIPCHILDREN and WS_CLIPSIBLINGS are the key here. Of course, many people don't understand them (eventhough it's not hard and the Petzold came out, what, 25 years ago?) but win32 is very well understood by now and it's trivial to make extremely fast (by today's standards) UI's with it, and relatively easily, too.
- dcbadacd 8y agoNot OP, but sure, if I spend a few hours as a new Windows programmer I can finally make my native Windows application not flicker on resize, but that's most likely not it, there's probably a stload of other things I have to spend a few hours on to get things somewhat properly-working. It's a massive cost compared to what default web already offers. Then I have to repeat that same years-long process for Android, iOS, OSX and Linux. Or I can just make a web application that's slightly slower. The decision was super simple for me. F* native development of UIs, it's stuck, everyone in it think it's fine - it probably is if it's all you do - but what matters a lot of the time is the sum of development cost across all supported platforms. shudder That means it's especially horrible if it's just you developing something, the chance that a single developer could support all of the most used platforms (Win, Linux, OSX, Android, iOS) is so unlikely due to the time required to learn just a single one of those platforms.
- gshulegaard 8y agoYou can choose to die on the proverbial hill that is “performance”, but in doing so all you are doing is looking at the world through a key hole. When making decisions about software in the world, performance is just one of many considerations. If performance was the only dimension, we wouldn’t have had reason to move past Assembly.
- wheelie_boy 8y agoThis is a very silly argument: compile and runtime speed is not the only consideration to take into account. Otherwise we would all be programming assembly, or heck, just write machine code directly and skip the time-consuming assembler. Speed is important, but so is good debugger support, productive UI tools, developer productivity, training requirements, available libraries, target market, etc. At the end of the day, most people make pragmatic decisions, taking lots of factors into account. A good historical example of this is Word vs. WordPerfect. There are many reasons why Word won, but one of them is that WordPerfect was written in assembly. This was helpful at the beginning as it was good for performance, but their developer productivity suffered as the codebase increased. This resulted in fewer features, which is also something that customers care about. Few customers care how quickly you can do something they don't want to do. Also, he's conflating toy problems, where getting the big-O right is the only important thing, with real-world applications where the constants are also important.
- shhehebehdh 8y agoThe article is interesting food for thought, but there’s a fundamental error. In the toy algorithmic problems, having the wrong big O solution is wrong because it doesn’t finish in a satisfactory amount of time. From this he seems to infer that anything that takes longer than another alternative is “wrong.” But the thing that made the toy solution wrong does not transfer to the other example problems! An editor dropping frames clearly isn’t sufficient to render it unusable for a significant slice of the target audience (proof by existence).
- alexashka 8y agoReplace 'wrong' with 'sucks' and you'll be much closer to getting what the author's saying.
- redka 8y agoStill doesn't make the metaphor make any sense. If anything, it is proving the exact opposite point since when it comes to programing languages/environments the difference in speed is much more comparable to the 10-30ms from the example (negligible) than to the "years" - the one being "wrong".
- Kapura 8y agoReading through this reminded me a lot of what Jon Blow has been saying [1] about programming as he's been writing his new language specifically tailored for games. He talks about how ridiculous it is that C++ compiles can eat up so much time in a programmer's day, and how programmers are not generally taught how to write efficient data structures and thing about things like locality and access patterns. And that's when you can reason about the access patterns. When you're running things out of a browser, you are even further removed from the metal and likely using a grab bag of web frameworks and libraries that you don't control (or fully understand). And it's easier to keep using them rather than think about what it would take to make things run well and invest in that future. (You may not even have the ability to make that decision). Luckily, it does seem that people are becoming aware of the issue, at least in some circles. I've now seen a number of articles with titles like "Why I have turned my back on the church of Object Oriented Programming," and with people like Mike Acton speaking at cppcon [2] to talk about data structuring, hopefully the next generations of application developers will be equipped to make things fast again. [1] https://www.youtube.com/watch?v=HLk4eiGUic8 https://www.youtube.com/watch?v=HLk4eiGUic8 [2] https://www.youtube.com/watch?v=rX0ItVEVjHc https://www.youtube.com/watch?v=rX0ItVEVjHc
- jchw 8y agoIt feels like large parts of the reason C++ compilation is slow could be solved by modules. Maybe some day?
- aj7 8y agoAsk HN: How often is time needed to program the most important temporal measure? [For non-developers, I’d guess 95%]
- twblalock 8y agoPerformance is a tradeoff. Sometimes shipping a feature is more important. Sometimes cross-platform support matters more than native speed. Sometimes performance optimizations are a distraction from other, more important, work.
- giornogiovanna 8y agoI just wish there was something that had it all! But until that exists, performance is one of those things where you just need to be adequate. Very few people choose between applications based on performance, anyway (and it's usually too late to switch if performance becomes a concern).
- javajosh 8y agoA discrete compilation step is optional. The most sophisticated way to run a program is within an interpreter where runtime analysis is used to determine which parts, if any, of the program to compile, and with what "flags". Transpilation, however, is by definition not optional. It is frustrating to hear a complaint about someone who chose to write in Clojure, itself a layer on the JVM interpreter, and then chose to support a transpilation target, Clojurescript. If compile times bother you, then pick another stack. However, if you want to write code in a functional way and target both the JVM and JS, then this is the price you pay.
- wwweston 8y ago> HTML is a pretty inefficient way to put pixels on a screen. This is completely true. HTML is also more than a way to put pixels on a screen. I'm utterly sympathetic to complaints about Electron apps (which I generally avoid because they feel wrong to me too), and to the idea that the web could/should perform better, and even that it is wrong for many applications. But if one primarily conceives HTML as a pixel placement scheme, one is goig to make some poor judgments about what it's right or wrong for. This arguably works in tandem with the piece at some points -- "the web" in general (and some specific stacks or architecture choices) is/are probably used in situations it is wrong for because the related tech is what people know rather than because all the engineering decisions involve informed matches between characteristics and requirements. And yet it reveals some limits about any judgment that the web in general is "wrong," and perhaps indicated the author should have demonstrated more of the wise principle of thinking about what one is getting. If there is one place where "it is fast or it is wrong" is often incorrect, it's in thinking. (See also: Knuth's rules about optimization.)
- catpolice 8y agoI'm sympathetic to some of the conclusions here but jeez, this is a really bad argument. A lot of other commenters point out ways that it's bad, and they're mostly right. The crux of the issue is that the argument really relies on the notion of comparing two things that supposedly do "the same thing", but you really have to ignore almost everything that could ever factor into the decision between them in order to consider them the same, and what the thing is shifts from moment to moment. The Advent of Code example is fine. Here, we have two different algorithms that perform the same computational task, and there's a performance gap because they're not the same algorithm and have have radically different time complexities. In the Clojure vs. Clojurescript example, the author has picked a library that can run tests on the JVM or as transpiled JS code in a browser. The end result code is doing the same thing in a different sense because it implements pretty much the same algorithm (modulo technical differences in the underlying intermediate platforms). But the first performance comparison is between the Clojure and Clojurescript compile times. Trust me, there's almost no sense in which compiling the Clojure language to the bytecode it was designed to be compiled to and translating it into a different high level language in a performance-sensitive way can be considered the same task. So it's unclear why that's supposed to be meaningful. And the test-timing comparison is also a little funny, since the JS still has to be JIT compiled to machine code, which is much more complex than the equivalent bytecode compilation - there's a sense in which it's more similar to the Clojure compilation step (which takes 6.5 seconds) and it happens in less than a second. But anyway, one can argue that all-in-all it's the same code and it's doing the same thing in the end and the one that does it in the browser is slower. But that's only the case because of that specific choice to compare library tests that can target either the JVM or the browser. That's not a choice that makes sense in general. You don't pick between those two compilers in a vacuum - you're not going to use Clojurescript unless your code needs to run in a browser. And you _can't_ use vanilla Clojure in that case. If running in a browser is a requirement, then the compile speed and runtime performance of vanilla Clojure is meaningless because it doesn't run on the platform your program is being delivered on. The author is comparing a library that can be compiled either way and run on either platform - but the actual real world code that library is used in wouldn't have that property, and the performance comparison is pretty meaningless. I'm going to skip the next bit because it goes further off the rails in ways that are mostly unimportant. I think there are some less charitable ways to read the conclusion, but let's go with this: don't build applications (especially things like text editors) on the web platform, because it's super inefficient. You can make faster applications, therefore, you should. Here's the thing: you won't, and if you do, they won't succeed. We wish our text editors weren't so resource intensive, but the responsiveness of basic text editing operations isn't what most of us look for in an editor. There are slimmer native text editors out there; their development and the development of the surrounding ecosystem moves incredibly slowly because they weren't built on a pre-existing extensible platform that thousands of developers are familiar with and so very few people want to work on them. And that makes them cumbersome for a lot of tasks, which means a lot of people won't use them. The platform that our bloated text editors are built on is part of what they do. So a faster editor that isn't built on a familiar, extensible platform doesn't do the same thing faster - it does a subset of the things I care about, at the expense of the reasons that cause me to put up with my current editor's bloat. You can make a faster X for any X that runs on the web platform, but to do that you're going to have to build it on less general-purpose, extensible technologies, and in many (but not all!) cases, that alone going to doom the project. And if you want to build something that does all the things the web platform does, but more efficiently, good luck. Sure, HTML/CSS/Javascript are built on a lot of design missteps, so it's theoretically possible, but I think the ship has sailed on starting completely over.
- sandreas 8y agoIn my opinion, the article serves its purpose: It polarizes. And quite rightly so. While it is relatively easy to develop portable websites, this does not work for real Applications in most cases. After researching how to create a GUI in Java, QT, GTK+, etc., I found out for myself that a platform-independent GUI design can be a difficult topic, especially when it comes to GREAT usability. I don't think, that Electron Apps provide GREAT usability - they do their job and are cheap to produce. In a world where JavaScript and browser technologies are used to justify low maintenance costs, better portability and the lack of skills, it can be helpful to critically question the arguments for it, which the author does. Especially when this attitude only shifts costs from the manufacturer to the customer, e.g. under the time-to-market aspect. While the manufacturer is saving time and money, the users and customers pay for it. And this is the real argument for me - manufacturers want to save costs. Costs for: - qualified staff - maintenance - portable applications - time to market In my opinion the only way prevent more and more Web-Based GUIs is doing it better and being successful with it - not an easy task. So thank you for this polarizing but interesting article.
- patsplat 8y agoThis seems to be more a benchmark for ClosureScript rather than "the web"
- qwerty456127 8y agoSo true. The only problem there is no really good cros-platform GUI framework so far. If only there was something like WPF (and in no way inferior to the original) easily and naturally usable with a good selection of programming languages on all the major platforms (Windows, Linux, Mac, Android, Ios) I doubt many people would use Electron. The whole thing about browser-based apps is they run everywhere seamlessly while looking eye-candy, being easy to discover, one-click to run and written in a language with a steep learning curve and that all is for free in whatever a case (while e.g. Qt requires an expensive license if you want to make a non-free app).
- jcelerier 8y agoQt is LGPL, you don't need a license to maje a proprietary app with it (chromium and thus electron are under LGPL too)
- qwerty456127 8y agoGood. I've read at least PyQT required a license. Qt Design Studio (which could be a "killer feature" to attract people to the platform) certainly does and even for a free project acquiring a free license for it is either hard or impossible.
- pseudalopex 8y agoPyQt is GPL/commercial. Qt for Python is LGPL.
- deleted 8y ago[deleted]
- qwerty456127 8y ago> The same applies to all languages with terribly long build times. It’s not that they couldn’t build faster. They just choose not to. C++ or Rust program compiles for too long? Well, OCaml could probably compile the equivalent program in under a second. And it’ll still be machine-level fast. > “Wow, wow, slow down! This is even more unfair! Now it’s not just apples and oranges, now it’s toothbrushes and spaceships. You completely ignore what each language brings to the table. There’s a reason they spend so much time compiling, you know?” So what's the reason if the resulting performance doesn't differ much? C/C++ build times seem insane to me. Every time I try to install an Aur package and see it starts building C/C++ I cancel it and give up the idea as I don't want to wait a day for my CPU load to drop below 100% and my SSD free space usually happens to be not enough anyway.