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

fix(scripts): run downlevel-dts script in parallel #2837

Merged
merged 9 commits into from
Sep 28, 2021

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Sep 27, 2021

Issue

Refs: #2834 (comment)

Description

Runs downlevel-dts scripts in parallel to improve performance.

Before
$ foreach dir ("lib" "packages" "clients" "protocol_tests")
  for d in $dir/* ;do (cd "$d" && rm -rf dist/types/ts3.4); done
end

$ time yarn downlevel-dts
yarn run v1.22.11
$ node ./scripts/downlevel-dts
Done in 699.06s.
yarn downlevel-dts  1165.78s user 64.57s system 175% cpu 11:39.19 total
After
$ foreach dir ("lib" "packages" "clients" "protocol_tests")
  for d in $dir/* ;do (cd "$d" && rm -rf dist/types/ts3.4); done
end

$ time yarn downlevel-dts
yarn run v1.22.11
$ node --es-module-specifier-resolution=node ./scripts/downlevel-dts
Done in 58.73s.
yarn downlevel-dts  1977.88s user 84.27s system 3503% cpu 58.863 total

Testing

Verified that comments are removed from *.d.ts files.

Tested by running manually running local downlevel-dts in packages/abort-controller followed by running global downlevel-dts:

Before
$ head dist/types/ts3.4/AbortSignal.d.ts
import { AbortHandler, AbortSignal as IAbortSignal } from "@aws-sdk/types";
export declare class AbortSignal implements IAbortSignal {
    onabort: AbortHandler | null;
    private _aborted;
    constructor();
    /*
    * Whether the associated operation has already been cancelled.
    */
    readonly aborted: boolean;
    /**
After
$ head dist/types/ts3.4/AbortSignal.d.ts
import { AbortHandler, AbortSignal as IAbortSignal } from "@aws-sdk/types";
export declare class AbortSignal implements IAbortSignal {
    onabort: AbortHandler | null;
    private _aborted;
    constructor();

    readonly aborted: boolean;

    abort(): void;
}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-commenter
Copy link

Codecov Report

Merging #2837 (4de7f60) into main (2923d66) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2837   +/-   ##
=======================================
  Coverage   60.41%   60.41%           
=======================================
  Files         554      554           
  Lines       28885    28885           
  Branches     7072     7072           
=======================================
  Hits        17452    17452           
  Misses      11433    11433           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2923d66...4de7f60. Read the comment docs.

await downlevelWorkspace(workspacesDir, workspaceName);
});

parallelLimit(tasks, cpus().length, function (err) {
Copy link
Contributor

Choose a reason for hiding this comment

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

async module is pretty awesome!

@trivikr trivikr merged commit 0f8c0a2 into aws:main Sep 28, 2021
@trivikr trivikr deleted the run-downlevel-dts-parallel branch September 28, 2021 20:15
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants