Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve build perf #75983

Closed
25 tasks done
joaomoreno opened this issue Jun 24, 2019 · 6 comments
Closed
25 tasks done

Improve build perf #75983

joaomoreno opened this issue Jun 24, 2019 · 6 comments
Assignees
Labels
debt Code quality issues engineering VS Code - Build / issue tracking / etc. vscode-build VS Code build process issues
Milestone

Comments

@joaomoreno
Copy link
Member

joaomoreno commented Jun 24, 2019

Several perf problems with the build that need to be addressed:

  • All agents do the same compilation/optimization/minification
  • Each extension get compiled/optimized/webpacked 6 (!) times
  • node.exe gets downloaded 2 times
  • macOS agents seem slower than before, though they end up doing more than others:
    • Sourcemaps
    • Bundle stats (Submitted bundle stats)

DONE ✔️

  • Remove VSCODE_WEB hack, create vscode-web-* tasks
  • De-duplicate compilation tasks
    • Remove old extensions compilation
    • Dedupe extensions build
    • Cleanup Node.JS downloading
    • Dedupe Node.JS downloading
    • Dedupe vscode build
      • Alpine
      • ARM
  • Verify Webpack catches TS type errors
  • Use the Yarn cache task
  • Run common steps only once in a separate Linux build agent
    • Hygiene
    • Compilation
    • Optimization & minification
    • Cache result in VSTS artifacts, such that other agents and successive build resubmissions can simply pick that up
  • Have VSCODE_COMPILE_ONLY flag
  • Get template for arm/alpine
  • Remove node build/lib/builtInExtensions.js
  • Move quality/*/package.json dependencies into actual package.json dependencies
  • Deduplicate extension compilation Remove legacy extensions compilation from build #77058
  • Cleanup VSCODE_ARCH usages in Linux build 7b0cd32
  • Set sensible values for task timeout
  • Lower agent parallel jobs
  • Move sourcemaps to common agent
  • Move bundle stats to common agent
  • Move upload-configuration to common agent

Task Step Windows Linux macOS Unit
Prepare build   11 6.5 7.5 min
Build   25 21 45 min
           
VS Code compile-client-build 170 160 215 sec
  optimize-vscode 31 31 86 sec
  minify-vscode 152 139 290 sec
  vscode-win32-x64-min 259 191 436 sec
           
Server compile-client-build 146 134 198 sec
  optimize-vscode-reh 5 5 16 sec
  minify-vscode-reh 27 23 79 sec
  vscode-reh-win32-x64-min 169 113 312 sec
           
Web compile-client-build 148 136 188 sec
  optimize-vscode-reh 27 28 64 sec
  minify-vscode-reh (web) 134 120 273 sec
  vscode-reh-win32-x64-min (web) 167 116 329 sec
           
Unit   1.5 1 1.5 min
Integration   9 0 8 min
Publish   6 4 0.5 min
@joaomoreno joaomoreno added debt Code quality issues vscode-build VS Code build process issues engineering VS Code - Build / issue tracking / etc. labels Jun 24, 2019
@joaomoreno joaomoreno changed the title Improve build speed Improve build perf Jun 24, 2019
@joaomoreno joaomoreno added this to the July 2019 milestone Jun 25, 2019
@joaomoreno
Copy link
Member Author

joaomoreno commented Jul 1, 2019

Removing old extensions build and deduping extension webpacking across all three targets brought the build time down from 1114s to 379s: 3x speedup.

@joaomoreno
Copy link
Member Author

Deduping TypeScript compilation brought it further down to 264s: 4x speedup.

@joaomoreno
Copy link
Member Author

joaomoreno commented Jul 3, 2019

Merged deduplication effort. Here are the improvements for the build step, given two sample builds:

Step Before After Speedup
Windows 23m 15m 1.5x
Windows32 27m 15m 1.8x
Linux 19m 10m 1.9x
LinuxArmHf 6m 6m 1x
LinuxAlpine 14m 8m 1.75x
macOS 41m 16m 2.5x

@joaomoreno
Copy link
Member Author

joaomoreno commented Jul 3, 2019

Adding Yarn cache:

Step Before After Speedup
Windows (x64, ia32) 9m 4m 2.3x
Linux (x64, arm, alpine) 4m 2m 2x
macOS 4m 3m 1.3x

@joaomoreno
Copy link
Member Author

joaomoreno commented Jul 3, 2019

Here are some really exciting numbers for the shared agent which runs hygiene checks, telemetry gathering and core & extensions compilation:

Type of Build Duration
No Cache 15m
Cached Dependencies (99% of builds) 10m
Rebuild Same Commit 3m

Platform specific agents can just pick up this agent's work and proceed with testing, packaging, signing and publishing.

@joaomoreno
Copy link
Member Author

joaomoreno commented Jul 4, 2019

Some more preliminary numbers, for total build times:

Step Before After Speedup
Windows 58m 44m 1.3x
Windows32 59m 46m 1.3x
Linux 38m 23m 1.7x
LinuxArmHf 22m 21m 1x
LinuxAlpine 23m 26m 0.9x
macOS 68m 42m 1.6x

There's still a bit more to go through. We're still compiling extensions twice unnecessarily, for example.

joaomoreno added a commit that referenced this issue Jul 14, 2019
joaomoreno added a commit that referenced this issue Jul 14, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues engineering VS Code - Build / issue tracking / etc. vscode-build VS Code build process issues
Projects
None yet
Development

No branches or pull requests

1 participant