News for hackers. Stuff that matters.
Re:New MacBook Air by rvanmil on Wednesday March 18, 2020 @08:59AM (#22616107)
Anyone here who has experience working with JS/TS development tools (vscode, yarn, webpack, Node.js etc.) on a recent MacBook Air? I wonder if the performance is noticeably worse than a 13” MacBook Pro for this type of work.
Re:New MacBook Air by technotarek on Wednesday March 18, 2020 @09:06AM (#22616166)
Up until late 2018, my MBA 2013 was doing ok with a stack transitioning to full js/ts. Now it’s close to unusable as our projects build multiple containers, load hundreds of node packages etc. Unfortunately, the 2019 MBA isn’t much better. I’m still wondering whether to hold until a new MBP 13/14”, or give this a try.
Re:New MacBook Air by ehutch79 on Wednesday March 18, 2020 @09:19AM (#22616287)
A typical JS developer is not building/rebuilding docker containers constantly.
Re:New MacBook Air by technotarek on Wednesday March 18, 2020 @09:51AM (#22616614)
That's correct. Not building/re-building the containers constantly. However, the initial build takes forever and some containers tend to crash (e.g., Prisma). Plus, in our case where we're using Angular, the recompiling of the app on change sends the fan into overdrive and I get noticeable lag on application switching. Again, this is on a 2013 MBA, which is almost ridiculous, but I'm that type of person. Still proudly sporting my iPhone SE. My development partner is on the 2019 MBA and has noticed improvement, but albeit rather underwhelming.

As an aside, I haven't taken the time to pin point the exact problem, but as much I prefer to use Firefox, it doesn't seem to do a great job of managing resources for the SPAs we're building.

Re:New MacBook Air by ricketycricket on Wednesday March 18, 2020 @09:59AM (#22616703)
Make sure your node_modules directory is mapped to a local volume inside docker (not synced to your Mac). This dramatically improves build performance in Docker for Mac. If using docker compose, try this out https://stackoverflow.com/questions/29181032/add-a-volume-to...
Re:New MacBook Air by estebarb on Wednesday March 18, 2020 @10:08AM (#22616792)
JS build times? I guess that I haven't touched JS development in a while... My Early 2011 MBP (with SSD and RAM upgrade to 16GB) still rocks with intensive information retrieval and other big data tasks (Go, Java, Python).
Re:New MacBook Air by ehutch79 on Wednesday March 18, 2020 @10:00AM (#22616715)
This is a dumb question, but you're talking about using docker, right? Doesn't docker spin up an entire vm for containers? That does seem pretty heavy for a MBA of any generation?
Re:New MacBook Air by menssen on Wednesday March 18, 2020 @10:38AM (#22617100)
It's almost impressive that Docker-on-macOS works so seamlessly that people are downvoting this comment. Yes, Docker containers run in a Linux VM on macOS. It's just one though, and generally seems fine on low resource workstations, unlike Vagrant setups from a few years ago that tried to run a VM for every application.
Re:New MacBook Air by qayxc on Wednesday March 18, 2020 @10:17AM (#22616885)
It's not a VM, which is the point of docker in the first place.

I agree, though, that it's next to unusable on a low-power dual-core system like the MBA if only for limited RAM.

Re:New MacBook Air by mcpeepants on Wednesday March 18, 2020 @10:25AM (#22616977)
docker on mac does indeed leverage a VM as the docker host, since a Linux kernel is required
Re:New MacBook Air by qayxc on Wednesday March 18, 2020 @11:04AM (#22617402)
To my understanding Docker doesn't do hardware virtualisation and doesn't run indiviual VMs per container instance, though, or does it?
Re:New MacBook Air by mcpeepants on Wednesday March 18, 2020 @11:38AM (#22617789)
it does not, but there is still some overhead running a single linux VM for the docker host on macOS
Re:New MacBook Air by hobofan on Wednesday March 18, 2020 @10:13AM (#22616837)
> Doesn't docker spin up an entire vm for containers?

(It generally does not. Instead it uses more lightweight isolation primtives. That has always been one of its main selling points.)

EDIT: see reply

> That does seem pretty heavy for a MBA of any generation?

It very much depends on what you are running inside the containers. I regularly have a dev environment with ~8 relatively lightweight containers running on my Early 2014 MBA without any problems.

Re:New MacBook Air by mikewhy on Wednesday March 18, 2020 @10:33AM (#22617050)
Docker for Mac very much uses a VM. It's as lightweight as it can be (using the OS-supplied hypervisor, not something third party), but still a VM.
Re:New MacBook Air by ecnahc515 on Wednesday March 18, 2020 @01:01PM (#22618774)
The context is on MacOS. Docker is a Linux technology, it runs Linux containers, thus it requires a Linux VM to run Docker on a Mac.
Re:New MacBook Air by kasey_junk on Wednesday March 18, 2020 @09:24AM (#22616343)
It seems pretty typical for js backend systems to be heavily containerized such that I’d say it’s approaching the default deployment mechanism.
Re:New MacBook Air by ehutch79 on Wednesday March 18, 2020 @09:32AM (#22616434)
Why would you keep rebuilding the container constantly though?
Re:New MacBook Air by ehutch79 on Wednesday March 18, 2020 @09:47AM (#22616575)
kasey: For deployment that makes sense, but for development, that seems like a lot of work to be happening.

If you change a small bit of css, the whole container is rebuilt? That seems super inefficient to me?

My backends arn't JS, but I still couldn't imagine rebuilding a container everytime I changed a piece of code. Right now I change a file, django picks up the change and reloads. No noticeable delay.

Re:New MacBook Air by nikanj on Wednesday March 18, 2020 @11:08AM (#22617450)
Because JS. And somehow we the developers convinced each other that -any- attention to performance whatsoever is "premature optimization".
Re:New MacBook Air by inapis on Wednesday March 18, 2020 @11:29AM (#22617690)
This has got nothing to do with JS. Plenty of devs (me included) work on frontend and backend JS without containers and everything is instant for us. OP has a special use case or build pipeline necessitating such complexity.
Re:New MacBook Air by kasey_junk on Wednesday March 18, 2020 @09:40AM (#22616498)
Typically build flows don’t mount the js with volumes they embed it in the image. I’m not cognizant enough of the trade offs to know why.
Re:New MacBook Air by bpicolo on Wednesday March 18, 2020 @09:46AM (#22616564)
Optimizing your local workflows is worth the effort at every team size.

I think the attempts to make local workflows mirror production 1:1 (local k8s, for example) are misguided. They miss too hard on the productivity story. Especially once you start having to swap out local debugging for remote debugging (which only a handful of languages support effectively).

This is the biggest miss for many companies striving for microservice architecture. The local development story is terrible, and it stays terrible, without a lot of opinionated decisions around what your dev workflow needs to look like past the ~3-5 services mark. At a past gig I had to change 5 different repositories (5 separate PRs, all needing approval) to send an email. In a rails app that would have been a trivial task.

Re:New MacBook Air by inapis on Wednesday March 18, 2020 @12:45PM (#22618596)
> At a past gig I had to change 5 different repositories (5 separate PRs, all needing approval) to send an email. In a rails app that would have been a trivial task.

That sounds like no thought was put in the system before development. Well thought out scopes & contracts between services should not create a situation like that. Reminds me of a commenter on HN who were rolling back changes to all microservices if one service needed a rollback. These kinds of issues are dead giveaways that devs are paying lip-service to "microservices." Also, devs need to understand that they don't need to be on microservices or on the latest fad. Use what works for the team. A 10-team of devs cannot necessarily adopt workflows of a FAANG.

Re:New MacBook Air by bpicolo on Friday March 20, 2020 @08:38AM (#22637052)
Here's the complexity story, if you're curious.

1. Terraform repo for AWS deploy

2. Step functions application logic (server-side polling daemon)

3. Email service template

4. Feature flag configuration

5. (Something in the monolith to trigger the workflow, probably?)

This wasn't an entirely small engineering org - 300-400+ devs?

I agree, though, is the point. I think folk don't put enough thought into the development story when going this route. I think monorepos are the only sensible way to go about it once folk have cross-service work to accomplish, and monoliths are a _good_ way to build applications for longer than folk give them credit. That said, some monoliths are more productive than others. Slow startup/compilation can destroy productivity.

Re:New MacBook Air by solat on Wednesday March 18, 2020 @09:27AM (#22616371)
Not really but when you try new config/Dockerfiles/docker-compose setups it's nice to have power + bandwidth. Thus, I develop on a remote server.
Re:New MacBook Air by solat on Wednesday March 18, 2020 @09:24AM (#22616338)
While this MBA turned out really well, current Windows featuring WSL2 is quite impressive though. Having a full Ubuntu or Debian on your machine is priceless. Or you develop on a remote server, then you just need a good terminal. So currently both macOS and Windows are good for JS dev. It's a matter of taste and price.
Re:New MacBook Air by homarp on Wednesday March 18, 2020 @09:33AM (#22616444)
Re:New MacBook Air by snemvalts on Wednesday March 18, 2020 @09:27AM (#22616373)
i think most people prefer to not sell their souls for advertising when it comes to their desktop environments.
Re:New MacBook Air by solat on Wednesday March 18, 2020 @09:35AM (#22616465)
Do you mean the start menu? I never open it, just use Win + number for pinned apps.

Windows is not perfect but it excels in many regards nowadays and the last years, Macs were really expensive and risky. They were too expensive to just have a fall-back machine lying around (if you make serious money with you gear, every hour counts). I have 3x 2.5lb notebooks here, if one needs to be sent in, so what.

Edit: just opened it but there are no ads... what do you mean?

Re:New MacBook Air by snemvalts on Wednesday March 18, 2020 @09:47AM (#22616569)
Regardless of using the start menu or not, there's a lot of background tracking (for user behaviour and ads) that needs to be disabled by registry edits. In addition to those, there's probably more that cannot be disabled.
Re:New MacBook Air by qayxc on Wednesday March 18, 2020 @10:25AM (#22616980)
Replacing /Windows/System32/Drivers/etc/hosts isn't black magic and truly works wonders even for the more paranoid ;)

What I don't understand about this, however, are people being paranoid about W10 while they're happily accepting Google and friends to infiltrate their lives ¯\_(ツ)_/¯

You are of course exempt if you don't use any cloud-based services that you don't host yourself :D

Re:New MacBook Air by catalogia on Wednesday March 18, 2020 @10:44AM (#22617181)
> Regardless of using the start menu or not, there's a lot of background tracking (for user behaviour and ads) that needs to be disabled by registry edits.

That stuff also has a nasty tendency to ""accidentally"" get re-enabled after updates from many reports I've heard.

Re:New MacBook Air by api on Wednesday March 18, 2020 @09:34AM (#22616448)
Yeah, the presence of ads on anything I've paid for instantly classifies it as "junk." Windows is now junk.
Re:New MacBook Air by kaibee on Wednesday March 18, 2020 @09:50AM (#22616598)
Re:New MacBook Air by abacadaba on Wednesday March 18, 2020 @11:28AM (#22617666)
Shame, really. Not even a viable option for personal use.
Re:New MacBook Air by FpUser on Wednesday March 18, 2020 @11:38AM (#22617793)
I am curious where do you people see ads. I do not have any on my windows computers. All hold latest official updates.
Re:New MacBook Air by api on Wednesday March 18, 2020 @12:04PM (#22618119)
Last fresh Windows install I did came pre-loaded with a bunch of loot box style gaming crap, Candy Crush, Xbox stuff, Netflix, Amazon Prime, loads of other foistware that should not exist on a fresh install.

A new Windows install requires at least an hour of de-cluttering and shit removal, while for a new Mac full setup to my liking takes about 5-10 minutes and I generally don't have to uninstall much of anything. The only thing I sometimes remove are apps I never personally use like Garage Band to save a bit of disk space, and that takes like ten seconds.

Then there's the almost Android level of obviously spyware telemetry going on. Yes I know Apple has telemetry but I trust them quite a bit more than Microsoft both not to do anything deliberately sketchy with my data and to be competent with their security. They also do a lot less and a lot less invasive telemetry. Redirecting local search, sending file list dumps, etc. to the mothership is unforgivable unless I have explicitly opted into that kind of behavior e.g. for tech support or debugging. That's the kind of stuff I associate with borderline malware, not an OS by a supposedly reputable company that I paid for.

Microsoft's recent behavior is pegging them in the low end of the market and ceding the high end of the market to Apple. Then of course there's Linux. If Apple did something barking stupid that forced me to ditch the platform that's where I'd go. I'd miss the Apple degree of trouble-free operation but at least I'd keep my privacy and security and lack of foistware.

Re:New MacBook Air by FpUser on Wednesday March 18, 2020 @02:14PM (#22619592)
I asked specifically about ads as I do not have those so curious why others do. I do not need generic Windows criticism as I am using it without any problem for like eternity, so do not really give a hoot if somebody else does not like it. I have whole bunch of Windows and Linux computers (laptops and desktops/servers) and am happy like a clam.

"Ceding high end of the market to Apple". I would not go into much details but for example my gaming grade laptop runs circles around Mac that costs twice as much. So sure I'd rather be a "low end" peon with the decent hardware.

Re:New MacBook Air by FpUser on Wednesday March 18, 2020 @11:35AM (#22617754)
I just looked at mine, no ads. In anyways I do not use start menu to launch apps. I just do Ctrl+Esc or Win key and proceed to type name of the app. 2-3 latters is normally enough to auto-fill result and off you go. I can't remember last time I used mouse to hunt apps in a menu
Re:New MacBook Air by AgloeDreams on Wednesday March 18, 2020 @01:12PM (#22618885)
Even Chrome OS is pretty great. I found Crostini to be wonderful (esp in v82) and the Pixelbook Go has fantastic haptic impressions to me. The Keyboard is perfection.
Re:New MacBook Air by AgloeDreams on Wednesday March 18, 2020 @01:10PM (#22618863)
Webpack, very very large Angular project with over 2500 jasmine tests. I'm using a 2017 Air i5 8GB (First gen of new design, Came from a 2016 Macbook Pro 15 i7 (so other end of the spectrum)

Node performance has gotten a lot better since some updates, there was a period where CPU use and performance was just bad. I think it was a webpack bug. But now things are pretty good! Runs Sketch and other graphics apps not too bad. As a comparison, It seems to be much faster at compile and test running than running the project on Chrome OS Crostini on my ChromeBook Pixel LS (higher wattage, older, i7 + 16GB ram) I imagine the Quad core in this would smoke the LS.

Re:New MacBook Air by bluedino on Wednesday March 18, 2020 @09:23AM (#22616336)
The current 13" Pro is a beast compared to the Air. It's as fast as the older 15" Pro, while the Air is a bit slower than the current 13" Pro.
Re:New MacBook Air by abrowne on Wednesday March 18, 2020 @09:28AM (#22616379)
Keep in mind the MBP 13 with 4 ports has a 28 W chip, while the one with 2 ports has a 15 W chip (IIRC).
Re:New MacBook Air by twsted on Wednesday March 18, 2020 @09:06AM (#22616167)
It's perfect from a performance point of view. I own the last generation (so no scissor keyboard) and I work the whole day in VSCode with JS/TS, Python, Go, Rust, etc.
Re:New MacBook Air by christiansakai on Wednesday March 18, 2020 @09:30AM (#22616400)
how's your Rust compile time in this?
Re:New MacBook Air by shirshak55 on Wednesday March 18, 2020 @09:46AM (#22616566)
i don't know how is he able to compile rust. I have 2 core MBP 13inch 2017 macbook pro.

Rust compilation takes like 15 seconds for small changes in actix project. For amethyst game library i wouldn't even try.

Re:New MacBook Air by twsted on Wednesday March 18, 2020 @10:33AM (#22617045)
Yeah.. given my age, perhaps I'm quite relaxed about compilation times...
Re:New MacBook Air by davedx on Wednesday March 18, 2020 @09:46AM (#22616567)
I have a 2017 Macbook Pro and the main project I work on brings it to its knees. This is a front end project with a nodejs graphql server, TypeScript, eslint, VS.Code, webpack. I think actually the linting is the worst CPU drain, but all in all with the graphql server and front end tooling running at once, it makes my laptop slower than running the .NET core back end it connects to.

Kind of annoying. Working with a simple create-react-app project with TypeScript is fine though.

Re:New MacBook Air by ehutch79 on Wednesday March 18, 2020 @09:54AM (#22616648)
There's something wrong with your setup &| stack. I've run a full stack locally, a build setup with a watcher, a django/gunicorn setup with file watching, mysql/redis/rabbitmq, and i barely nudge the cpu.

I'm betting your if you cpu is hot constantly while developing, it's file watching that's the issue. I had to do some work to get things to use proper file system events in macos and not just polling with my legacy gulp project. try installing fsevents if it's not already?

Re:New MacBook Air by revscat on Wednesday March 18, 2020 @10:17AM (#22616879)
There is something wrong. I’m running two separate Rails apps, MySQL, Oracle, RabbitMQ as a broker between the two apps, Redis, and both have Angular FEs that I use VSC with. Same year MBP, and my CPU load rarely reaches 5%.
Re:New MacBook Air by AgloeDreams on Wednesday March 18, 2020 @01:15PM (#22618913)
Check your package updates! We had the SAME issue in serving the app on macOS and no issue on windows. Updating node and updating to latest packages produced a 80% cpu drop. When I had this issue I couldn't serve the project while running VS code on my Air, the lag from input was way too bad, now it's snappy.
Re:New MacBook Air by leetrout on Wednesday March 18, 2020 @09:31AM (#22616416)
Yes. It’s miserable with any substantial JS project. Those extra cores should help with the new model.
Re:New MacBook Air by fastball on Wednesday March 18, 2020 @10:15AM (#22616858)
I thought NodeJS was single-threaded?
Re:New MacBook Air by qayxc on Wednesday March 18, 2020 @10:21AM (#22616942)
NodeJS is, but neither modules nor backends have to be. It's quite common to spin up a bunch of docker containers that provide databases and backends locally.

This is the point at which the MBA stops being a productive environment. I'm not saying this has to be the case for every project, but if your team uses local dev environments, it's quasi standard procedure at this point.

Re:New MacBook Air by fastball on Wednesday March 18, 2020 @05:47PM (#22621575)
Right, but the GC was talking about developing JS applications on their computer, so presumably they were referring to compiling frontend JS projects, which multiple cores would not help, I think.
Re:New MacBook Air by leetrout on Wednesday March 18, 2020 @10:22AM (#22616951)
It is but running a single threaded build process with resource contention from chrome, vs code, slack, etc etc will improve with more cores.

If you are using make to call Babel or other JS build tools you can use the jobs flag to parallelize it and again the cores will help.