5

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%

  • Proxy settings don't matter if you are not using internet. Try resetting local npm cache. trying to think if there maybe clash in some angular package/dependency versions. may need more information to point out the exact issue here. Make sure that both your machines were restarted recently. – ronakvp Apr 20 '20 at 19:24
  • How about defender or any other AV for the node process and the npm cache dir? – Robin Dijkhof Jul 18 '20 at 14:19
  • yep, excluded the Angular folder from Defender, we turned off Fireye, have no AV –  Jul 18 '20 at 18:22
  • Did you try any other CPU benchmark? – phhbr Jul 21 '20 at 07:53
  • hi @phhbr how do I do that for testing cpu benchmark? –  Jul 21 '20 at 08:57
  • You could use 7-Zip for example. Run 7-Zip, go to 'Tools' and then benchmark. Compare your values with your co-workers to see if you got any serious differences in performance using the same settings. – phhbr Jul 21 '20 at 11:39
  • Can you try on a third identical machine to get an idea? – David Jul 23 '20 at 17:35
  • maybe wsl2 helps https://stackoverflow.com/a/66481419/1359764 – Ramil Gilfanov Mar 14 '21 at 11:08

2 Answers2

0

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
Leon Radley
  • 7,596
  • 5
  • 35
  • 54
0

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.

Amirhossein Mehrvarzi
  • 18,024
  • 7
  • 45
  • 70
  • would this explain the issue as to why, my coworker has lot faster build times with exact same Git repo and config parametesr? –  Jul 21 '20 at 16:14
  • also, I already attempted Uninstalling and Reinstalling Angular and Nodejs –  Jul 21 '20 at 16:17
  • every time you try to install dependencies (`npm i`) there may be differences. Are you sure about the sameness for all the installed dependency versions? – Amirhossein Mehrvarzi Jul 21 '20 at 16:19
  • I believe you should find it in dependency version mismatch between 2 computers. – Amirhossein Mehrvarzi Jul 21 '20 at 16:22
  • I have so many packages, not sure which one is related to saas loader, I also deleted my repo, and redownloaded, same issue –  Jul 22 '20 at 05:19
  • what do I look for anyway, a higher or lower version? this is real confusing to beginner in Angular –  Jul 22 '20 at 05:21
  • just fyi, I just compared package-lock.json with coworker, they are the exact same, compared through source control –  Jul 22 '20 at 05:45
  • I never spoke about comparing *package* or *package-lock* files ! just compare installed package versions inside *node_modules*. **For comparison reason**, You have to ensure the same versions installed in *node_modules* for both computers. – Amirhossein Mehrvarzi Jul 23 '20 at 10:12
  • ok, taking a look, so many files,and not sure what is related to saas loader –  Jul 23 '20 at 10:20
  • At least copy the entire *node_modules* files from one computer to another and repeat the test. In this way, we insure about versions. Make the target directory clear before starting to copy. – Amirhossein Mehrvarzi Jul 23 '20 at 10:28