Skip to content

how much time do you cost to build nodejs? #3015

Closed

Description

@anlexN
  • Node.js Version: 14.13.1
  • OS: Windows WSL ubuntu
  • Scope (install, code, runtime, meta, other?): all
  • Module (and version) (if relevant): all
  • gcc/g++ version: 9.3.0
  • python: 3.8.5
  • make: 4.2.1

i have tried to build nodejs for 13 times, and every time, it cost me about 1 hours and 13 minutes. oh my god. please help me. teachers!

Activity

  1. changed the title [-]how much time do you take to build nodejs?[/-] [+]how much time do you cost to build nodejs?[/+] on Oct 11, 2020
  2. PoojaDurgad commented on Oct 14, 2020

    @PoojaDurgad

    @anlexN - I have also tried to build nodejs on ubuntu platform. It cost more than an hour as building takes more time because it requires a lot of work that is lot of cpu time.

  3. anlexN commented on Oct 15, 2020

    @anlexN
    Author

    oh my god. so what system do you recommand to build nodejs?

  4. gireeshpunathil commented on Oct 15, 2020

    @gireeshpunathil
    Member

    My observation is ~20 minutes of work - in a single CPU system

    • if you have 2 CPUs, run with -j2 , makes it ~10 mins
    • " " 4 CPUs, " .. -j41 to make it ~5 mins
    • so on and so forth
  5. anlexN commented on Oct 16, 2020

    @anlexN
    Author

    why need -j arg? i just make, in theory, make should use infinite jobs.
    image

  6. gireeshpunathil commented on Oct 16, 2020

    @gireeshpunathil
    Member

    infinite jobs with no arg. is meant for -j flag. That is:
    -j100 means 100 jobs at once
    -j means infinite jobs at once // this can be tricky, based on your CPU availability though. (I never tried this)

  7. anlexN commented on Oct 16, 2020

    @anlexN
    Author

    @gireeshpunathil

    1. this is my system information:
      image
    2. i am using windows wsl ubuntu 20.04
    3. i turn on my computer performance mode.

    but i make -j4, it still costs me more than 1 hour, and you can see my cpu temperature is almost 100C. oh my god! what happened?

  8. gireeshpunathil commented on Oct 16, 2020

    @gireeshpunathil
    Member

    @anlexN - sorry, most of the letters in the screen is not readable for me (I guess it is Chinese?). Do you have a mechanism to figure out how many CPUs are there in your system? If not, can you get the output of systeminfo in the command line ? that will tell us.

    If there is only one CPU, then adding -j flag is of no use. Only if there are multiple CPUs, the work can be parallelized and thereby time saved.

    with respect to CPU temperature - I guess most of the work involved in building node from source is compilation, which is heavily CPU bound, the momentary spike in heat level is justified.

  9. anlexN commented on Oct 17, 2020

    @anlexN
    Author

    this is my systeminfo:
    image

    my computer customer service tell me all lenovo computer have only one CPU, include me. so i can not make -j, so nodejs need us have a very high hardware requirement? @gireeshpunathil , can you give me your systeminfo?

  10. gireeshpunathil commented on Oct 17, 2020

    @gireeshpunathil
    Member

    I have many systems that I work on.

    Mainly, a linux box with 120 CPUs and 1 TB memory - this takes only a minute to build node.

    My laptop is an apple macbook with:

      Processor Name:	Intel Core i5
      Processor Speed:	2.9 GHz
      Number of Processors:	1
      Total Number of Cores:	2
      L2 Cache (per Core):	256 KB
      L3 Cache:	3 MB
      Hyper-Threading Technology:	Enabled
      Memory:	8 GB
    

    as I told, this takes ~20 minutes with -j4.

    This this because when there are 2 cores, it is as good as having 2 CPUs from the program's perspective.

    Again, with 2 cores and hyperthreading, each core can execute roughly 2 jobs in parallel.

    So consider this as having ~4 CPUs. So I usually give -j4. It still heats up the CPU a little, but as I know it is a computation intensive operation and is bound to limited time, I will wait.

  11. anlexN commented on Oct 17, 2020

    @anlexN
    Author

    @gireeshpunathil can you try to build in windows wsl ubuntu 20.04? please.

  12. gireeshpunathil commented on Oct 17, 2020

    @gireeshpunathil
    Member

    @anlexN - sorry, I don't have such a system. But let me see, if one of my colleague can try this. Will get back in couple of days.

  13. anlexN commented on Oct 17, 2020

    @anlexN
    Author

    i am waiting for you, teacher.

  14. sxa commented on Oct 19, 2020

    @sxa
    Member

    I would say that an hour or so for building Node.js was reasonable for such a configuration. There is a lot of code in Node.js including athe V8 runtime. If you're going to be building it multiple times I'd recommend using ccache which will make subsequent runs significantly faster.

  15. anlexN commented on Oct 20, 2020

    @anlexN
    Author

    changing nodejs build system is so necessary!

  16. 3 remaining items

  17. anlexN commented on Oct 21, 2020

    @anlexN
    Author

    i hope to decrease build time, i think you can try another build system: GN or Ninja or Bazel.

  18. anlexN commented on Nov 16, 2020

    @anlexN
    Author

    nodejs source code have perl file, oh my god! now at total, there are 7 languages: c, c++, python, javascript, torque, shell, perl. oh my god. can we give up perl language?

  19. sxa commented on Nov 16, 2020

    @sxa
    Member

    The Node.js codebase includes versions of third party components which are built and statically linked in during the build process. The perl code is mostly from the openssl and ICU componenets (plus the one from the CURL project for SSL CA certs) and it would not be appropriate to diverge from what those dependent projects use.

  20. anlexN commented on Nov 16, 2020

    @anlexN
    Author

    it costs me so long time to understand node source code, oh my god.

  21. PoojaDurgad commented on May 31, 2021

    @PoojaDurgad

    looks like it can be closed now . pls let me know if that is not the case

  22. J-Cake commented on Jun 13, 2022

    @J-Cake

    I have many systems that I work on.

    Mainly, a linux box with 120 CPUs and 1 TB memory - this takes only a minute to build node.

    @gireeshpunathil Good sir, where does one buy such a machine ? I want one :P

  23. F3n67u commented on Jun 13, 2022

    @F3n67u

    I have many systems that I work on.
    Mainly, a linux box with 120 CPUs and 1 TB memory - this takes only a minute to build node.

    @gireeshpunathil Good sir, where does one buy such a machine ? I want one :P

    I am also very curious how you can buy such a monster computer?

  24. leizongmin commented on Jun 13, 2022

    @leizongmin

    It took 7 minutes to compile on my machine (32 cores 64G memory, GCC 8.3.0).

  25. J-Cake commented on Jun 13, 2022

    @J-Cake

    It took 7 minutes to compile on my machine (32 cores 64G memory, GCC 8.3.0).

    ~ 11 mins. and two failed attempts on my end. not too bad

  26. gireeshpunathil commented on Jun 13, 2022

    @gireeshpunathil
    Member

    @gireeshpunathil Good sir, where does one buy such a machine ? I want one :P

    honestly, I don't know. I use machines from my company, that are purchased and installed by h/w folks. :P

  27. J-Cake commented on Jun 13, 2022

    @J-Cake

    Wow that's quite the equipment they've got there. Mind me asking what the company is?

  28. gireeshpunathil commented on Jun 13, 2022

    @gireeshpunathil
    Member

    Wow that's quite the equipment they've got there. Mind me asking what the company is?

    sorry, but I think it is off-topic as it does not directly contribute to the resolution of the issue. (my GitHub profile contains my details)

  29. anlexN commented on Jun 15, 2022

    @anlexN
    Author

    it's nodejs build system problem by itself, not a money problem, not a computer problem.

  30. ytxmobile98 commented on Nov 30, 2022

    @ytxmobile98

    Tried using a DELL Inspiron 14 Plus laptop and a DELL Optiplex 7090 desktop.

    • OS: Inspiron 14: Ubuntu 22.04 LTS; Optiplex: Ubuntu 22.04 LTS as WSL on Windows 11 21H2.
    • CPU: Inspiron 14 uses i7-12700H; Optiplex uses i7-12700.
    • Memory: Inspiron 14 has 16 GB (8 integrated + 8 slot); Optiplex has 32 GB (8 + 8 + 8 + 8).

    Build commands:

    sudo apt install build-essential ninja-build
    ./configure --ninja
    make -j
    • Inspiron 14 Plus: The build process died half-way.
    • Optiplex 7090: 11m23.318s
      Screenshot_20221130_045709
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions