Hacker News new | ask | show | jobs
by redthrowaway 2255 days ago
npm is still a disaster, but for other reasons:

    $ time rm -rf node_modules/

    real 1m2.969s 
    user 0m0.409s
    sys  0m15.853s
3 comments

Are you using a 5400rpm hdd?

In an existing UI project repo... ci (which clears node_modules) then installs from lock...

    added 1880 packages in 23.283s

    real    0m24.073s
    user    0m0.000s
    sys     0m0.135s
Still slower than I'd like... but I'm pretty judicious in terms of what I let come in regarding dependencies. That's react, redux, react-redux, material-ui, parcel (for webpack, babel, etc) and a few other dependencies.

For one of the API packages ci over an existing install...

    added 1069 packages in 12.911s

    real    0m13.708s
    user    0m0.045s
    sys     0m0.076s
So either you're including the kitchen sink, or you're running on a really slow drive.
they're running a mac probably it takes forever to rm -rf a directory on macs vs linux.
Have not had this experience. I find Macs to be faster in fact as the SSDs are normally much faster than most linux machines.
This isn't about SSD speed. Reading large file is comparable, but there is a very large overhead on the initial file access because of sandboxing.

Opening (or deleting) an empty file is about 2.5x slower on OSX than on a Linux running in VirtualBox on that same Mac: https://discuss.rubyonrails.org/t/why-is-rails-boot-so-slow-...

You called it. I didn't know OSX was bad for that though
Me either...

Was using a hackintosh and rmbp until about 2 years ago, stopped using mac at work, and in october switched to a new desktop and jumped to linux. Been back in windows + wsl2 for a couple months now.

Back using mac, and most of my windows until a couple months ago, was still mostly linux via VM.

Guess I never realized how slow macos's file system was for deleting files.

edit: Also, for those curious, WSL2 files in Windows is slow, and windows files in wsl are slow... each are fast in their own sandbox.

SSD on a 2018 MBP with an i7
I just use yarn. V2 forces PNP by default which speeds up the installation by 2-3x.

https://yarnpkg.com/features/pnp

You are saying it is like you don't have to put JDK to your Dockerized java apps. (pick any language you want that is not statically compiled)
Nothing dockerized locally. This is a bare bones NextJS front end.

    $ npm list --depth=0
    <removed for opsec>
    ├── @babel/plugin-proposal-class-properties@7.8.3
    ├── @babel/plugin-proposal-decorators@7.8.3
    ├── @graphql-codegen/cli@1.13.2 extraneous
    ├── @graphql-codegen/core@1.13.2
    ├── @graphql-codegen/typescript@1.13.2
    ├── @graphql-codegen/typescript-graphql-request@1.13.2
    ├── @graphql-codegen/typescript-operations@1.13.2
    ├── @graphql-toolkit/core@0.10.3
    ├── @graphql-toolkit/url-loader@0.10.3
    ├── @types/lodash@4.14.149
    ├── @types/node@13.11.1
    ├── @types/react@16.9.34
    ├── @types/reactstrap@8.4.2
    ├── @zeit/next-css@1.0.1
    ├── @zeit/next-sass@1.0.1
    ├── babel-plugin-module-resolver@4.0.0
    ├── bootstrap@4.4.1
    ├── dotenv@8.2.0
    ├── express@4.17.1
    ├── UNMET PEER DEPENDENCY graphql@15.0.0
    ├── graphql-request@1.8.2
    ├── graphql-tag@2.10.3
    ├── helmet@3.22.0
    ├── isomorphic-unfetch@3.0.0
    ├── UNMET PEER DEPENDENCY jquery@1.9.1 - 3
    ├── lodash@4.17.15
    ├── mobx@5.15.4
    ├── mobx-react@6.1.8
    ├── next@9.3.4
    ├── next-fonts@1.0.3
    ├── node-sass@4.13.1
    ├── nodemon@2.0.2
    ├── react@16.13.1
    ├── react-dom@16.13.1
    ├── reactstrap@8.4.1
    ├── styled-components@5.0.1
    ├── styled-icons@10.2.1
    ├── ts-node@8.8.2
    └── typescript@3.8.3
My point is that to avoid node_modules in other libraries you just install dependencies globally with JDK or like