How to Break Apple’s M1 Chip

 1 year ago
source link: https://debugger.medium.com/how-to-break-apples-m1-chip-ccdcbe3bf0df
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
How to Break Apple’s M1 Chip. My bad Dropbox organization habits…

Responses (22)

Dude, just put your projects on github. Just the thought of having `node_modules` in Dropbox makes me cringe so hard 😅
I wonder when the internet will evolve to the point where we don’t need to write click-bait titles. I was genuinely interested in this being insight into a potential flaw in the M1 design, but instead it’s a story of someone’s bad habit.
I have to agree with a lot of responders, you shouldn’t be keeping your node_modules folder anywhere really (even on GitHub). The projects package.json should be enough, as when you get on a new machine a simple `npm init` or `yarn init` would re-download your packages.


The problem is that Dropbox stores hashes of files and in node_modules there are often same files twice – having same hash.
Code should be stored in Git repository instead. The modules folder is not contained as it can be always recreated by npm install command.
This isn’t an M1 problem, or a macOS problem, it’s a fundamental design of both DropBox (why can’t it cope with large hierarchies?) and Node problem (why create such a mess by design). Oh dear.
I have had countless issues with dropbox/onedrive etc for the same reason. I finally got a NAS and demonstrated superhuman self control. I moved old projects to an archive area on my NAS. I can't wait to get my hands on some new ARM computers now. Their future is so bright!
Just using the opportunity to say that I think the node_module hierarchy is a horrible design. Some projects will break on Windows due to crazy long paths and sometimes deleting the whole hierarchy is problematic too.
i kinda had the same problem with iCloud, i resolved by renaming those directories node_modules.nosync and then making a symlink with the correct name, hence: ln -s node_modules.nosync node_modules
Occam’s Razor + Common sense = Drop Dropbox❗️
I did that years ago, and … survived.😎

You have 2 free member-only stories left this month.

How to Break Apple’s M1 Chip

My bad Dropbox organization habits brought Apple’s power-sipping MacBook Air to its knees in just a single day

The Apple M1 chip computer logo seen on a mobile phone screen next to a larger Apple logo
The Apple M1 chip computer logo seen on a mobile phone screen next to a larger Apple logo
Photo illustration: Pavlo Gonchar/SOPA Images/LightRocket/Getty Images

I’m not a video editor, but I’m pretty sure I brutally slayed the M1 MacBook Air I just bought (8 GB RAM and a 512 gigabyte SSD, in case you were wondering) in less than a day of use.

It comes down to two reasons, really: The lack of an Apple Silicon-optimized Dropbox app (it’s coming), and a solid decade-plus track record of bad habits in terms of how I store my old projects.

So, here’s the deal: For a number of years, the content management system I used for my newsletter was based on Node.js, which generally stores its many parts inside of folders called node_modules. Any small Node applet inside of the primary Node app can also have a node_modules folder. These apps basically build on one another, creating a Russian nesting doll of sorts, each folder filled with its own tiny folders, of which there can be thousands included in a single directory.

Dropbox traditionally has not handled lots of small files particularly well. And in the past, my Dropbox folder has brought computers large and small to their knees… and made them kick up the fans.

Here was a fanless, highly optimized computer with a chipset said to allow for comically robust battery life — Apple claims 18 hours, and many reviewers have gotten close to that. How’d it do? Well at first, I thought it was holding its own. However, I soon noticed that Dropbox was taking up three-quarters of my RAM, and that my swap file was reaching 10 gigabytes in size. Even after letting it sit around overnight to sync, it still wasn’t done — and worse, I started seeing beach balls.

The culprit? All those dang node_modules folders. I would keep these old folders of my CMS around as backups of local installs on the off-chance something would break. (Eventually, I started compressing them.)

At some point, it sucked up so much power I decided to unplug my laptop to see how fast it would drain the battery. In about two and a half hours, I managed to knock out two-thirds of the computer’s battery life, by which time I had made a point to remove syncing capabilities on every folder with node_modules as a subfolder. It seems on track for about four and a half hours while plugged into a monitor… even after all that.

I’m a special case. I experiment a lot with random things, and my Dropbox folder is like a storage locker that’s never been organized. It is totally unfair to Dropbox to blame them for my bad storage habits.

And on top of all that, it’s not fair to criticize Dropbox for having an app that appears to otherwise work fine on a brand-new architecture at a time when around 15% of Intel apps aren’t, according to “Does it ARM.” (And glitches are common; my web browser of choice, Vivaldi, does this on the Twitter website right now.)

But a suggestion to Dropbox as they create an Apple Silicon version of their namesake app: Automatically disable syncing on any folder named node_modules. I promise you, nobody will miss them.

About Joyk

Aggregate valuable and interesting links.
Joyk means Joy of geeK