Git Product home page Git Product logo

Comments (3)

rlue avatar rlue commented on June 18, 2024

Scratch that; on further inspection, it looks like node just takes that long to load. I inserted a console.log debug statement at the top of the which script, and it shows that 500ms+ pass before the first line of the script is evaluated:

#!/usr/bin/env node
console.log((new Date().getTime()) - Number(process.env.START))
var which = require("../")
...
$ START=$(($(date '+%s%N')/1000000)) which which
570
/usr/local/share/.config/yarn/global/node_modules/.bin/which

I don't suppose there's any chance you'd know offhand why node is so slow?

from node-which.

isaacs avatar isaacs commented on June 18, 2024

I'm not sure offhand, I mean, apart from "it does a bunch of stuff". I'd love to see node's startup time come down.

from node-which.

rlue avatar rlue commented on June 18, 2024

@isaacs thanks for the feedback; I did some more digging on my own, and it looks like nvm node runs fast enough (70ms); it's only the official APT package provided by nodesource.com that's slow. Filed an issue on their repo, as referenced in the timeline above.

from node-which.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.