TransWikia.com

Angular compiler is slow between two identical model laptops

Stack Overflow Asked by user12425844 on December 27, 2021

Coworker and I are trying to figure out why compilation times are different. We have the same exact Dell Laptop 7030 model, same SSD, same hard drive, same memory, specs. Our task manager process look similar.

Corporate orders the identical model computers.

We are downloading from Angular Git Repository, with config and package json, with same node size memory.

Question is, Initial build between our laptops is 2 min compared to 8 min.

When we edit a single word in same file, his only takes 5 seconds to recompile, my takes 20 seconds.
Only programs running on the identical computer is Angular command ng serve.

Does anyone have ideas to resolve this issue, and slow compile time?

Is there anything I can change in my work station to the compile speed similar?

Attemped the solutions for all coworkers, still slow

  • We have same Node.js versions
  • updated from Angular 8 to 10 in Company Project Git Repo
  • tried npm cache clear
  • attempted Uninstalling and Reinstalling Angular and Nodejs
  • ScanDisk from Windows does not show errors on SSD drive
  • compared package-lock.json with coworker, they are the exact same, compared in source control diff
  • turned on Windows Defender Exclusion on the Angular Git Folder

Resources:

Angular compilation slow

How to speed up the Angular build process

Update:

Just noticed my laptop really stalls on styles.scss file at 48%

2 Answers

As you described enough, All the things are the same, whether node or angular versions, Hardware models, software and configurations. You also ensured that build pipelines are the same.

The only thing which comes to mind is a few difference in dependencies, yes the version mismatch inside node_modules packages. Considering that when you dont specify exact versions like ^x.x.x (aka semantic versioning) includes everything greater than the particular version in the same major range for dependency to be installed by npm or yarn. There's a tool named npm semver to show this. In this way, You have to check the installed packages versions too, by opening each one and looking inside package.json file. Specially for those which you think affect the performance like sass loader. Performance for each release may be different.

Answered by Amirhossein Mehrvarzi on December 27, 2021

If you are running exactly the same codebase. I would with a high degree of confidence say that it is node.js or different npm versions that is the problem

try running

node --version

npm --version

yarn --version

to see which versions of them you have installed.

for angular 9 I would suggest running node 12, which is the current LTS (Long Time Support) version.

until node 14 which is also out now, but it's LTS release is not until october 2020.

I find yarn to be magnitudes faster than npm, so if you want a speed boost try running that if you haven't tried it.

Also Try clearing the npm cache, as mentioned per comments.

npm cache clear

Answered by Leon Radley on December 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP