by Kristine1975 on 3/23/17, 2:29 PM with 760 comments
by artursapek on 3/23/17, 3:17 PM
NPM had a progress bar that was so fancy that it slowed down installation time (basically its only job) by ~50%. Hilarious.
My mantra here is, if you find yourself thinking about implementing a fancy loading spinner/progress bar, it would be more productive to just spend that time making it unnecessary - speed up your shit! Obviously that doesn't apply to VS Code's cursor.
by Philipp__ on 3/23/17, 3:11 PM
Wouldn't it be better to make native application, especially for code editors, where developers spend most of their time, where every noticeable lag and glitches are not appreciated.
Edit: Many people here think that I am attacking this web based kind of technology, which I am not, and sorry for not being clear enough, but why chose something so high up the stack for dev tool?
Edit2: For non-believers in nested comments, look -> https://github.com/jhallen/joes-sandbox/tree/master/editor-p...
by aphextron on 3/23/17, 3:14 PM
Someone just posted some really embarassing benchmark numbers regarding this issue yesterday: https://github.com/jhallen/joes-sandbox/tree/master/editor-p...
Note that Atom and VSCode are nearly 10x slower than all the other competition, as well as simply crashing for many of the tests. To be fair, I do think Electron based desktop apps have their niche. Spotify is a perfect example. But they have no place in text editing.
by ChuckMcM on 3/23/17, 3:36 PM
by camgunz on 3/24/17, 8:07 AM
"But camgunz, I only know JavaScript"
That's cool! Look into QML.
"But camgunz, I only know X"
That's cool too! Qt4 has a truly ludicrous number of language bindings: https://en.wikipedia.org/wiki/List_of_language_bindings_for_.... Qt5 has a fair number too: https://wiki.qt.io/Language_Bindings.
"But camgunz, I need an embedded browser"
I agree, separate windows are for savages. Qt has you covered with Qt WebBrowser.
"I need a native look and feel across all platforms"
Well, that's a pipe dream. BUT, you can get closer with Qt than anything else. Google for some screenshots.
"I need a bananas style but I don't want to write any code"
Qt supports CSS-like stylesheets!
---
The web isn't a good application platform. Sure we could (and have been) spend billions of engineering hours and years to get it up to speed with exactly what we have now, but that's obviously a bad idea. We can figure out zero-install and sandboxing, but we just don't need to shoehorn everything into JS, weird APIs like localstorage and webrtc, and the DOM. We just don't need to.
by okket on 3/23/17, 3:01 PM
Workaround:
"editor.cursorBlinking": "solid"
by mmarks on 3/23/17, 3:31 PM
Not to take away but the author's point, just an aside that utilization numbers can be a lot more complicated when there are dozens of energy states and the utilization might be utilization at a particular state rather than utilization at maximum power
by tomc1985 on 3/23/17, 3:48 PM
by mschaef on 3/23/17, 3:09 PM
https://blogs.msdn.microsoft.com/oldnewthing/20031010-00/?p=...
by adamnemecek on 3/23/17, 3:04 PM
by c-smile on 3/23/17, 5:32 PM
With the GPU the only viable option for rendering blinking caret is to redraw the whole window. That's why it takes so much CPU as Chrome uses mostly CPU based rasterizer.
But redrawing the whole window in GPU is not that bad if the renderer is capable of caching GPU objects while rendering.
Here is what happens in Sciter (https://sciter.com) while rendering blinking caret in screen of similar complexity (editor with syntax hihglighting):
https://sciter.com/images/sciter-caret-cpu-consumption.png
As you see it CPU consumption is near to zero.
by Mahn on 3/23/17, 3:05 PM
by eranation on 3/23/17, 6:29 PM
by Skywing on 3/23/17, 3:59 PM
by kibwen on 3/23/17, 6:02 PM
by ohitsdom on 3/23/17, 3:44 PM
> The JS implementation uses an interval of 500ms between updates while native animations will be updating at 60Hz. At the moment we're not smart enough to deschedule ourselves during animations with step timing functions.
https://bugs.chromium.org/p/chromium/issues/detail?id=500259
by logicallee on 3/23/17, 5:17 PM
Well, apparently the web is built on whatever the opposite of that style of programming is.
by davidascher on 3/23/17, 3:04 PM
by agumonkey on 3/23/17, 8:20 PM
by makecheck on 3/23/17, 3:56 PM
For instance, if you have a graphics tool that briefly flashes screen updates, the problems are much easier to see. On a fast system, you might not only miss an unnecessary refresh of “everything”, you may miss a repeated refresh of the same content.
Also, on slower systems, the cost to generate a frame may delay an entire sequence. Consider something like “live resizing”: on your spiffy machine it seems fluid, on a lesser machine it might be stuttering like crazy. Sometimes you have to cheapen the computations occurring during rendering to make sure it’s OK.
by abrkn on 3/23/17, 3:06 PM
by Animats on 3/23/17, 6:24 PM
The QNX people were really embarrassed about that and fixed the screen saver. We just reconfigured to turn off the display entirely.
by jankotek on 3/23/17, 6:03 PM
https://blog.jetbrains.com/idea/2015/08/experimental-zero-la...
by bitwize on 3/23/17, 7:34 PM
Many of these same people will argue vehemently that X11, the shitty GUI layer for Linux that ran perfectly fine 20 years ago, is "slow" and "bloated" and needs to be replaced with Wayland, a new, completely different, shitty GUI layer.
by jokoon on 3/24/17, 12:23 PM
Personally I'm waiting for the second net bubble to burst, so that we can force everyone to use a stricter markup language.
Everyone is seeing how android apps are slowly but literally making HTML completely obsolete, and honestly that's an awesome thing, because it's really needed.
I hope the tech market realizes that and evolve quickly, instead of waiting for some battery breakthrough.
Never forget about the Andy Bernhardt video about the birth and death of javascript.
Those issues are why I will always target C++/java jobs and laugh at anything related to the "web". I am never short of the amount of analogies I can invent about HTML/JS. It's like comparing stick and stones to a decent steam engine.
by tete on 3/23/17, 5:30 PM
(Grace Hopper - Nanoseconds) https://www.youtube.com/watch?v=JEpsKnWZrJ8
by k__ on 3/23/17, 4:20 PM
Java developers have intelliJ IDEA, Eclipse and Netbeans, all written in Java.
JavaScript developers have Atom and VSCode. Since JS was created for HTML, it seems logical for me to use browser tech to build these editors.
It allows JS devs to build extensions without the need to learn a different language. As Java devs can build Eclipse plugins with Java.
Also, the Electron based editors aren't the only ones available, so it isn't as if someone would force the poor dumb JS developers to use these clunky slow tools, like when Slack built their client with Electron and you had to run a monster app for a simple chat.
If they want something faster, there is Sublime, Vim and Emacs...
by angrygoat on 3/23/17, 4:16 PM
Quote from the article;
> The blinking cursor causes the processor and GPU to be woken up frequently. On one of my test systems, this causes somewhere in the region of 2 Watts of extra power consumption.
This isn't about electron vs "native" apps. It's just that a smooth cursor animation rendered at 60Hz costs power; and if you look at the github issue, one config setting and that's gone, and so is the power usage when idle.
by qeternity on 3/23/17, 4:35 PM
by corford on 3/23/17, 10:32 PM
I almost want to swap back to using sublime out of protest but vscode's tighter git integration/workflow is hard to give up :(
Edit: I've always wondered why vscode couldn't be written in portable C/C++/Rust/D and then embed a V8 engine to power a javascript plugin API (a bit like sublime does with python)?
by saghm on 3/23/17, 7:28 PM
On another note, why is cursor blinking such a universal thing? I assume that other people must like it, or else it wouldn't be so common. Do people have trouble finding their cursor without it, or do they have trouble distinguishing it from actual text? I've never had either of those problems with blinking turned off, but I can't think of any other plausible reason.
by DonHopkins on 3/23/17, 4:24 PM
Implementing a WebGL based code editor for JavaScript - Rik Arends - GrunnJS [1]
How do you render text and update a code editor when it only has vertexbuffers? What can you do with it? What does an AST editor do to help? Rik Arends (founder of Ajax.org/Cloud9) will blow your mind with the talk. Note that this editor is work in progress.
[1] https://www.youtube.com/watch?v=hM1oLr9G3-Q
Here are some other talks about his work:
Rik Arends: Multi-threaded JavaScript inside Makepad [2]
As a web developer since the early 2000s, Rik has lived through the ups and downs of browsers all the way from IE3 to Chrome 52. From doing interactive web projects for big brands to working on Cloud9 IDE, the limitations of HTML have always been there. After leaving Cloud9 four years ago to explore the new possibilities that WebGL offers for UI, a continuous stream of WebGL-related projects have appeared, including a JavaScript trace debugger, a compile-to-JavaScript language and a live coding prototyping framework. Makepad is the latest from-scratch iteration of this WebGL direction, and it is exciting to share the progress and lessons learned.
[2] https://www.youtube.com/watch?v=tVTWdFE6-O0
Rik Arends: Beyond HTML and CSS: Fusing Javascript and shaders | JSConf EU 2014
What would the world look like when you can style UI with actual shader programs? The web could be 60fps on mobile, and we can start to imagine what lies beyond HTML and CSS
[3] https://www.youtube.com/watch?v=X8xxz-YeWtk
Here's a demo! [4]
by pointernil on 3/23/17, 6:46 PM
Constrain the resources to bring brack some sane levels of efficiency regarding ram/cpu-cycles/hd-space.
/scnr
by roryisok on 3/23/17, 8:32 PM
Is this a MacOS only issue? Does it affect Atom?
by coding123 on 3/23/17, 6:34 PM
by kelvin0 on 3/23/17, 6:37 PM
by rbanffy on 3/23/17, 4:12 PM
by kardashev on 3/23/17, 4:38 PM
That's why it's trivial to build a terminal app, but god help you if you want to create a window with a button or draw a line. GLEW, GLUT, Qt, OpenGL, and the rest are just kludges to deal with the fact that we're still working with tech from the 70's. Even those kludges are so terrible that companies like Github and Microsoft have resorted to using the browser to make things like Atom and Visual Studio Code.
It can be fixed, but I'm not sure anyone has the fortitude to redesign hardware and operating systems.
by ericfrederich on 3/23/17, 5:20 PM
I hope when Microsoft fixes this they publish some usage stats and we can see how much energy/money/carbon this will save annually.
by scriptproof on 3/24/17, 7:43 AM
by caseymarquis on 3/23/17, 6:48 PM
by joe563323 on 3/24/17, 9:09 AM
by GoToRO on 3/23/17, 4:32 PM
by CodeWriter23 on 3/23/17, 5:06 PM
by batmansmk on 3/23/17, 4:10 PM
by Ace17 on 3/24/17, 5:33 AM
by nebabyte on 3/24/17, 12:56 PM
I've identified the problem
by hesarenu on 3/24/17, 10:23 AM
by z3t4 on 3/24/17, 9:55 AM
by plg on 3/23/17, 3:10 PM
by excalibur on 3/23/17, 3:42 PM
by am185 on 3/24/17, 1:53 AM
by knodi on 3/23/17, 6:08 PM
by SippinLean on 3/23/17, 4:50 PM
will-change: opacity
to the CSS would improve performance (by switching CSS animation rendering to the GPU)https://medium.com/outsystems-experts/how-to-achieve-60-fps-...
by yAnonymous on 3/24/17, 9:44 AM
If you use the time you now spend complaining to code instead, you should have the basics covered.
by dingo_bat on 3/24/17, 7:45 AM
by vgy7ujm on 3/23/17, 3:48 PM
Vim <-- this
by billconan on 3/23/17, 3:46 PM
I don't think react would do much better, but I will have to try.
by onli on 3/23/17, 3:33 PM
by drzaiusapelord on 3/23/17, 3:18 PM
That's odd wording. Obsessed because I don't want to waste energy, which leads directly to pollution? Or don't want a short battery life on my laptop? Power savings shouldn't be seen as irrelevant geekery.
13% is half the capacity of a single core in a four core processor. My 5 year old 2500k peaks at 120 watts. So 15 watts to render a cursor?
Microsoft needs to stop it with these terrible levels of QC. Its inexcusable.
by LanceH on 3/23/17, 3:52 PM
On the other hand, I'm reminded of the arguments against emacs using 8 MEGS of memory and how terrible that is.
I've learned to just relax and use what works. People have chosen to concentrate on extensibility at the expense of current day performance. The result has been good enough.
There is probably something else to be said about these also making OSX a first class citizen, which hasn't always been true.