Skip to content

Conversation

@hensmi-amazon
Copy link
Contributor

@hensmi-amazon hensmi-amazon commented Feb 10, 2026

Issue #: N/A

Description of changes:

Changes

  1. Enable TypeScript incremental builds - Added incremental and composite to tsconfig, with project references between configs

  2. Inline build commands - Replaced npm run subcommands with direct commands to eliminate process spawn overhead

  3. Batch git lookups in check-code-style.js - Replaced per-file git check-ignore calls with single git ls-files lookup

  4. Add ESLint caching - Added --cache flag to lint command

  5. Remove redundant prebuild - Removed duplicate npm run prebuild call from mediatransform script

  6. Optimize postprocess-docs.js - Skip writing files that haven't changed

Performance Results

Task Before After (clean) Reduction After (incremental) Reduction
build 9s 6s 33% 2.8s 69%
lint 9s 9s 0% 1s 89%
check 29s 0.4s 99% 0.4s 99%
doc 9s 5.5s 39% 5.5s 39%
build:release total 47s 15.4s 67% 4.2s 91%
all tasks total 56s 20.9s 63% 9.7s 83%

Testing:

Builds

Checklist:

  1. Have you successfully run npm run build:release locally?
    y

  2. Do you add, modify, or delete public API definitions? If yes, has that been reviewed and approved?
    n

  3. Do you change the wire protocol, e.g. the request method? If yes, has that been reviewed and approved?
    n

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@hensmi-amazon hensmi-amazon requested a review from a team as a code owner February 10, 2026 22:35
@hensmi-amazon hensmi-amazon force-pushed the build-perf-optimizations branch from 2af3811 to d9dfacc Compare February 10, 2026 22:38
@hensmi-amazon hensmi-amazon changed the title Optimize build pipeline Optimize build pipeline: reduce non-unit tests by 63% (83% for incremental builds) Feb 10, 2026
@hensmi-amazon hensmi-amazon force-pushed the build-perf-optimizations branch 2 times, most recently from c763d95 to 0161bdb Compare February 10, 2026 22:56
"postdoc": "node script/postprocess-docs.js",
"test": "npm run test:fast",
"test:glob": "cross-env TS_NODE_PROJECT=test/tsconfig.json TS_NODE_CACHE=false nyc mocha --stack-trace-limit=1000 --async-stack-traces -v -r esm -rv ts-node/register -- ",
"test:fast": "npm run test:glob \"test/**/*.test.ts\"",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed test:slow. Have never seen that used.

@hensmi-amazon hensmi-amazon force-pushed the build-perf-optimizations branch from 0161bdb to f1b5949 Compare February 10, 2026 23:07
@hensmi-amazon hensmi-amazon changed the title Optimize build pipeline: reduce non-unit tests by 63% (83% for incremental builds) Optimize build pipeline: reduce non-unit tests by 67% (91% for incremental builds) Feb 10, 2026
@hensmi-amazon hensmi-amazon force-pushed the build-perf-optimizations branch from f1b5949 to c6d5ef5 Compare February 10, 2026 23:45
pracheth
pracheth previously approved these changes Feb 10, 2026
- Enable TypeScript incremental builds with project references
- Inline build commands to reduce npm spawn overhead
- Batch git lookups in check-code-style.js (29s -> 0.4s)
- Add ESLint caching (9s -> 1s incremental)
- Remove redundant prebuild call from mediatransform
- Skip unchanged files in postprocess-docs.js
@hensmi-amazon hensmi-amazon force-pushed the build-perf-optimizations branch from 778e70d to bd30fe6 Compare February 11, 2026 00:29
@hensmi-amazon hensmi-amazon merged commit 1e78269 into main Feb 11, 2026
7 checks passed
@hensmi-amazon hensmi-amazon deleted the build-perf-optimizations branch February 11, 2026 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants