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/jest scenarios #219

Merged
merged 4 commits into from
Jan 10, 2020
Merged

Fix/jest scenarios #219

merged 4 commits into from
Jan 10, 2020

Conversation

connor4312
Copy link
Member

@connor4312 connor4312 commented Jan 9, 2020

  1. fix: preserve source map handler even without pauses

    Previously removing this would prevent source maps getting resolved at runtime at all.

  2. fix: disable instrumentation bp in node by default

    It looks like in Jest the instrumentation BP is set, but because everything is on disk and we have the manually added entrypoint breakpoints, this is not needed.

  3. feat: move content hashing to a child process

    I noticed in profiles that this was actually a bottleneck for Jest tests
    (in Should it debug typescript files ? #214) when running as a cluster. I wanted to use a worker thread
    for it, but it looks like there's an issue in vscode preventing that[1]
    for the moment.

    This cuts the time-to-first-breakpoint in half for the jest tests, which
    is fairly nice. The child process is killed after 30 seconds of
    inactivity. I may do an algorithmic optimization pass on the hash in
    the future. In particular, Node/V8 now has native bigint support, which
    is almost certainly faster than the long library.

    1. Creating a worker thread in the extension host crashes VS Code vscode#88386

Fixes #214

Previously removing this would prevent source maps getting resolved at runtime at all.
I noticed in profiles that this was actually a bottleneck for Jest tests
(in #214) when running as a cluster. I wanted to use a worker thread
for it, but it looks like there's an issue in vscode preventing that[1]
for the moment.

This cuts the time-to-first-breakpoint in half for the jest tests, which
is fairly nice. The child process is killed after 30 seconds of
inactivity. I may do an algorithmic optimization pass on the hash in
the future. In particular, Node/V8 now has native bigint support, which
is almost certainly faster than the `long` library.

1. microsoft/vscode#88386
src/nodeDebugConfigurationProvider.ts Outdated Show resolved Hide resolved

const send = (req: HashRequest): Promise<string | undefined> => {
const cp = create();
cleanup();
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this call just start the 30s timer for the cleanup callback? It's not totally clear from the name alone.

Copy link
Member Author

@connor4312 connor4312 Jan 10, 2020

Choose a reason for hiding this comment

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

Yep, debouce will call the wrapped function 30 seconds after the last call to it. More explanation on debouncing

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. I'm familiar with debouncing, it just wasn't clear that calling cleanup() wasn't actually executing the cleanup method, but rather starting the debounce timer for the cleanup method.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, gotcha, I'll clarify that variable name on master!

@connor4312 connor4312 merged commit 56a882c into master Jan 10, 2020
@connor4312 connor4312 deleted the fix/jest-scenarios branch January 10, 2020 01:03
@connor4312 connor4312 added this to the January 2020 milestone Jan 27, 2020
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.

Should it debug typescript files ?
3 participants