dfds / backstage_originaldfdsfork

Backstage is an open platform for building developer portals
https://backstage.io
Apache License 2.0
0 stars 0 forks source link

Benchmark nodejs processes on windows dev machine #225

Closed ZaradarBH closed 2 years ago

ZaradarBH commented 3 years ago

What: We have experienced that certain tools (e.g. Terraform) are affected by domain policies when running on domain joined Windows machines. Why: Backstage building is SUPER slow on windows machines running on the domain. Could it be policies affecting it or is it just slow in general?


Test one-click scripts

ZaradarBH commented 3 years ago

Willi informed me that Richard & Pete has benchmarked Terraform/Terragrunt on domain joined PCs and concluded that there is about a ~80% drop in performance compared to non-domain joined machines

abstrask commented 3 years ago

Hi @ZaradarDFDS. I'm in contact with our endpoint management team, to setup a troubleshooting session. Can you prepare a playbook, with relatively short test we can run unattended and repeatable, to benchmark Node performance, now and as we tweak policies?

ZaradarBH commented 3 years ago

1: Prepare test machine

1.a) https://nodejs.org/en/download/ 1.b) https://git-scm.com/downloads

2: Download test code

2.a) git clone https://github.com/IBM/node-hello-world

3: Build test code

3.a) npm install 3.b) npm build

4: Run test code

4.a) npm start (without profiler) 4.b) npm start --prof (with profiler)

ZaradarBH commented 3 years ago

1: Prepare test machine

1.a) https://nodejs.org/en/download/ 1.b) https://git-scm.com/downloads 1.c) npm install -g typescript

2: Download Backstage code

2.a) git clone https://github.com/dfds/backstage

3: Build Backstage code

3.a) yarn install 3.b) yarn tsc 3.c) yarn build

3: Run Backstage frontend

3.a) yarn start (without profiler) 3.b) yarn start --prof (with profiler)

5 Run Backstage backend

3.a) cd packages/backend 3.b) yarn start (without profiler) 3.c) yarn start --prof (with profiler)

ZaradarBH commented 3 years ago

More info on NodeJS profiling can be found here @ https://nodejs.org/en/docs/guides/simple-profiling/

ZaradarBH commented 3 years ago

Also with regards to yarn vs npm here are some info @ https://www.geeksforgeeks.org/difference-between-npm-and-yarn/#:~:text=npm%3A%20npm%20fetches%20dependencies%20from,version)%20is%20present%20locally).

What interesting here is this:

"npm: npm fetches dependencies from the npm registry during every ‘npm install‘ command.

Yarn: yarn stores dependencies locally, and fetches from the disk during a ‘yarn add‘ command (assuming the dependency(with the specific version) is present locally)."

As this would probably indicate that everyone who uses NPM hit Windows Defender every time, where YARN only pays for the hit whenever its local dependency cache is out-of-sync

ZaradarBH commented 3 years ago

https://www.techrepublic.com/article/how-to-use-the-windows-10-assessment-tool-to-measure-system-performance/

ZaradarBH commented 3 years ago

https://github.com/dfds/client-performance-test/tree/main/backstage-test

ZaradarBH commented 2 years ago

I think this is the root cause of my problems @ https://www.nextofwindows.com/fix-yarn-npm-install-cause-high-cpu-usage-on-antimalware-service-executable => "Normally, a Windows system that has this real-time protection turned on (by default) compare to a Linux machine with the same hardware would be about 5-10 times slower."