News for hackers. Stuff that matters.
Re:Slack using React Dev Build in Production by tosh on Tuesday August 01, 2017 @08:11AM (#14899815)
Atom and Slack often get critiqued for their use of an HTML5 stack. I'd also like better performance when it comes to startup time, memory usage and responsiveness regarding interactions (I'm using a 12" Macbook) but the stack is so useful and universal that it is here to stay and worth figuring out how to get to great performance (similar to how Emacs figured out how to work around slow startup).

Are there examples for HTML5 apps that manage to have great performance? Are there inherent limits?

Re:Slack using React Dev Build in Production by sudhirj on Tuesday August 01, 2017 @09:07AM (#14900215)
If you look outside first world countries, yes. Check out the progressive web apps talks in Google IO 2017 - most of the examples on stage were indian companies flipkart.com, housing.com and a few others. I work on www.justickets.in myself.

We have a huge Android market here, but they're all phones with very low storage and slow 3G connections, so the default way to get an 'app' out is a HTML5 progressive web app. And the companies here work hard to make things run fast and smooth on slow devices.

Re:Slack using React Dev Build in Production by usegolang on Tuesday August 01, 2017 @09:39AM (#14900444)
I'm not sure how effective it is but I always liked the idea of forcing engineers to use those 3g speeds 1 day a week so they are more inclined to support those customers. Iirc FB does this to some degree, but I think they have a different lightweight version of FB intended for those audiences
Re:Slack using React Dev Build in Production by k__ on Tuesday August 01, 2017 @09:56AM (#14900608)
Sounds good, but in my experience 3g also varies by an order of magnitude (5 KB/s - 50 KB/s).

When I have 20-50 KB/s stable 3g, browsing the web is a bit slow, but most sites work pretty good. Also messenger aren't a problem.

But working below 20 KB/s is a pain.

Re:Slack using React Dev Build in Production by ed312 on Tuesday August 01, 2017 @11:14AM (#14901526)
Chrome dev tools has a reasonable connection bandwidth simulator. Is there a good one that also simulates variability / packet loss in addition to bandwidth caps?
Re:Slack using React Dev Build in Production by josephg on Tuesday August 01, 2017 @11:10AM (#14901461)
It'd be nice to have a simple way to limit a chrome tab's available CPU in the same way. The computers, tablets and phones most people browse on are an order of magnitude slower than the desktop machines we use to develop.
Re:Slack using React Dev Build in Production by irth on Wednesday August 02, 2017 @07:27AM (#14909647)
You can throttle the CPU in Chrome Devtools
Re:Slack using React Dev Build in Production by atonse on Tuesday August 01, 2017 @10:52AM (#14901216)
Yup – I love this idea. I actually occasionally test my single page apps under 3g connections to see how the loading experience works.
Re:Slack using React Dev Build in Production by jrimbault on Tuesday August 01, 2017 @09:14AM (#14900260)
Anecdotal, I remember a few months back someone showed here on HN "skytorrents.in", which I assume was made by an Indian, it was blazzingly fast.
Re:Slack using React Dev Build in Production by shash7 on Tuesday August 01, 2017 @10:24AM (#14900896)
Yeah I remember back in India page speed was a real concern not because google could penalize you but the network speed was so slow. Not sure now but back then Bsnl used to suck big time.

After coming to Australia, everyone here treats +4mb websites as normal which was a real mind twister for me. Thankfully pagespeed has always been my concern regardless of network speeds due to my 'conditioning' years ago.

Re:Slack using React Dev Build in Production by sokoloff on Tuesday August 01, 2017 @08:37AM (#14899988)
> similar to how Emacs figured out how to work around slow startup

By dumping binaries, creating emacsclient, but mostly by waiting 25+ years for fast computers w/SSDs to come along?

I love emacs, but slow startup was a problem for multiple decades, IMO.

Re:Slack using React Dev Build in Production by e40 on Tuesday August 01, 2017 @10:38AM (#14901063)
The emacs analogy is a terrible one. I start emacs once a month (or longer). I start slack once a day, sometimes more.
Re:Slack using React Dev Build in Production by marcelfahle on Tuesday August 01, 2017 @08:15AM (#14899854)
Discord is pretty snappy, even with tons of users..
Re:Slack using React Dev Build in Production by moron4hire on Tuesday August 01, 2017 @08:55AM (#14900128)
It's pretty buggy, though. On Windows, at least once a day it resizes down to a window only big enough to hold the X button to close the window. And it drains the hell out of my battery on Android.
Re:Slack using React Dev Build in Production by aczerepinski on Tuesday August 01, 2017 @08:13AM (#14899833)
VS Code performs well.
Re:Slack using React Dev Build in Production by lucideer on Tuesday August 01, 2017 @09:11AM (#14900247)
I'll second this.

There's been articles on HN specifically about how slow VS Code is, particularly the one about rendering cursor blinking, and of course anything running on Electron will never compete work the likes of vim, &c.

However, as Electron apps go, I've found it noticeably faster and less resource intensive than any others. Slack in particular is comparatively terrible, as was Atom in the past (people have said it's improved but I've not felt the need to try it again recently)

Re:Slack using React Dev Build in Production by porkloin on Tuesday August 01, 2017 @10:19AM (#14900847)
I've turned my vim into a monstrosity with plugins in the past - believe me, it's possible to make your vim just as laggy :)
Re:Slack using React Dev Build in Production by aspencer8111 on Tuesday August 01, 2017 @08:36AM (#14899982)
Currently running Slack App, Atom App, and Spotify App on my MBP. According to my system stats, I'm consuming 3GB of RAM across the entire system (OS and all of the above).

So what I would like to know is wtf everyone is doing in these apps to create this CRAZY amount of resource hogging they keep bitching about? Or are they rockin chomebooks? Seriously? I want to know where all of this nonsense is coming from?

Re:Slack using React Dev Build in Production by xigency on Tuesday August 01, 2017 @08:57AM (#14900149)
That is a crazy amount of resource hogging at 3GB.

You're running a music player, a text editor (or IDE), and a chat client. I would expect reasonably that would use less memory. One point you could make is that even native application alternatives, ones that don't use Electron, would be bloated and I would have to agree. Visual Studio .NET is pretty darn slow/cumbersome itself.

Re:Slack using React Dev Build in Production by tangue on Tuesday August 01, 2017 @09:11AM (#14900242)
Back in 1999 I was running Emacs, xchat and freeamp on my Pentium 66 with 16Mb of RAM. (an weak machine, even for 1999 but with Linux Mandrake and WindowMaker it was usable) The UI was less sophisticated and it doesn't involve network connection but sometimes I'm wondering how did we get there...
Re:Slack using React Dev Build in Production by acdha on Tuesday August 01, 2017 @10:41AM (#14901096)
A lot of this comes back to higher expectations: we now have much larger displays, color depths, instead of simple bitmap fonts we have much higher-quality rendered vectors with advanced layout systems which can complex scripts, etc. Instead of rendering into a shared buffer, each window has at least one (on OS X, two) full buffers and the whole thing is composited, which is great for responsiveness and visual quality but definitely uses In the 90s, 640x480 was a common display resolution — now Apple recommends that developers ship 512x512 icons.

That's not to say that there aren't decisions to reconsider about code size, resource formats, etc. but I think it's easy to forget how much more behaviour has moved into our default baseline assumptions.

Re:Slack using React Dev Build in Production by chickenfries on Tuesday August 01, 2017 @10:34AM (#14901019)
> doesn't involve network connection

In my very limited experience, this makes programming anything several times more complicated. Writing a document editor? Difficult. Writing a networked, multi-user document editor? As difficult as the last thing but with asynchrony and lots of new failure modes.

Re:Slack using React Dev Build in Production by 013a on Tuesday August 01, 2017 @10:49AM (#14901187)
Slack on my computer, with five teams, consumes 1.8gb of RAM.

Microsoft Word, with a multi-page complicated document, is using 200mb.

Just because we _have_ the resources to allow applications to bloat doesn't mean we should be alright with it. Its a similar argument to electric versus ICE cars; just because gas is cheap doesn't mean we shouldn't support EVs. EVs are fundamentally better for the future.

If we focus on performance optimizing the apps we use, it opens up a wide range of new computing hardware. You make fun of chromebooks, but imagine how much more interesting your work would be if you could use a machine with that performance. Battery life would be substantially higher. The cost of the machine would be substantially lower. The only reason most people need massive performance beasts is because we've pushed abstraction hell and bad engineering practices, so all of our tools suck.

Docker is another offender in recent times. Its great if you're on Linux, but few people are. So on OSX, we need to run a VM, so there goes another gig of memory.

Re:Slack using React Dev Build in Production by dsacco on Tuesday August 01, 2017 @09:13AM (#14900256)
3GB of RAM is precious (and I say that as someone who has 128GB)!

Your bar should not be, "Well, I don't see a slowdown." Many people still develop software on computers with only 8GB total RAM. Throw in a browser and one or two more applications and you're getting close to exhausting that.

Eventually you are going to exhaust your memory resources; using software with poor performance constraints is (in my opinion) inherently antagonistic to a development machine. That's not to say I'm against desktop JavaScript/HTML5 apps categorically, I just think they need much better optimization.

Re:Slack using React Dev Build in Production by lagadu on Tuesday August 01, 2017 @08:54AM (#14900123)
At least on Windows Slack is very memory-hungry, here's mine right now on my work laptop: http://i.imgur.com/76RQeHv.png

No idea why, it's only joining one team with under 20 people and ~5 channels.

Re:Slack using React Dev Build in Production by daxaxelrod on Tuesday August 01, 2017 @08:46AM (#14900051)
Fun Fact! The Spotify desktop client is written in C++! https://www.quora.com/What-is-the-technology-behind-the-Spot....

But I agree, Atom and Slack are really useful to if they consume another 250mb of ram because "It's not optimal", let them use it.

Re:Slack using React Dev Build in Production by ianhawes on Tuesday August 01, 2017 @08:53AM (#14900108)
The view layer is powered by Chromium Embedded Framework, so it's not entirely C++.
Re:Slack using React Dev Build in Production by daxaxelrod on Tuesday August 01, 2017 @09:12AM (#14900248)
Very true! I wonder how much more efficient the c++ makes the app in contrast to the node based electron infrastructure
Re:Slack using React Dev Build in Production by piva00 on Tuesday August 01, 2017 @08:51AM (#14900093)
Most of the time Slack is behaving quite well but I've experience it running into 80+% CPU for long periods of time while eating 2-3GiB of RAM, I always forced quit and didn't bother. But yes, sometimes it turns into a resource hog, same with VSCode or Atom, something sometimes makes them feel unresponsive and "laggy".
Re:Slack using React Dev Build in Production by merb on Tuesday August 01, 2017 @09:17AM (#14900292)
how's that even possible? I mean just the kernel + mds_store and mdworker of mac take like 2gb of memory.

I also run two java processes with 1gb predefined (well probably I could fine tune them to use 512mb). and one angular/cli which accounts for 800mb. plus my database which got 500mb aswell.

spotify on mac used way more than 500mb memory, the last time I used it and also had an extreme amount of i/o pressure. atom actually did use at least 500 mb memory as well, with just the c# plugin.

Re:Slack using React Dev Build in Production by 013a on Tuesday August 01, 2017 @10:35AM (#14901031)
Plenty. Discord, VSCode, and MongoBooster are all apps that I feel hit 90% of native performance while still being based on web tech. Hyper terminal is another one which has very specific reproducible performance issues, but overall is pretty great and fast.

Its incompetence on behalf of Slack and Github, not the tech itself.

Re:Slack using React Dev Build in Production by conradk on Tuesday August 01, 2017 @09:57AM (#14900622)
I've always found Fastmail's mobile app to be amazingly native-like even though it uses HTML5.
Re:Slack using React Dev Build in Production by dzhiurgis on Tuesday August 01, 2017 @10:24AM (#14900898)
I honestly don't understand why you need a desktop app to run chat.