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

[tunnel] JS Debug Terminal is too slow #167911

Closed
jrieken opened this issue Dec 2, 2022 · 1 comment · Fixed by microsoft/vscode-js-debug#1498
Closed

[tunnel] JS Debug Terminal is too slow #167911

jrieken opened this issue Dec 2, 2022 · 1 comment · Fixed by microsoft/vscode-js-debug#1498
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues papercut 🩸 A particularly annoying issue impacting someone on the team verified Verification succeeded
Milestone

Comments

@jrieken
Copy link
Member

jrieken commented Dec 2, 2022

  • use code tunnel
  • use vscode sources
  • open JS debug terminal
  • run yarn run gulp vscode-darwin-arm64
  • it takes 2 minutes before it actually starts doing something

The debug terminal is such a great too, esp for all the engineering work I am lately doing, but being a debugger-driven developer that's too much to endure.

@jrieken jrieken added the papercut 🩸 A particularly annoying issue impacting someone on the team label Dec 2, 2022
@jrieken jrieken changed the title JS Debug Terminal is too slow [tunnel] JS Debug Terminal is too slow Dec 2, 2022
@connor4312 connor4312 added bug Issue identified by VS Code Team member as probable bug code-cli labels Dec 5, 2022
@connor4312
Copy link
Member

connor4312 commented Dec 16, 2022

This isn't really related to the tunnel (js-debug is a workspace extension) but is a good opportunity to improve. Related: microsoft/vscode-js-debug#1149

@connor4312 connor4312 added debug Debug viewlet, configurations, breakpoints, adapter issues and removed code-cli labels Dec 16, 2022
connor4312 added a commit that referenced this issue Dec 16, 2022
@connor4312 connor4312 added this to the January 2023 milestone Dec 16, 2022
connor4312 added a commit to microsoft/vscode-js-debug that referenced this issue Dec 30, 2022
Fixes #1149
Fixes microsoft/vscode#167911

This does some overall system optimization for how the breakpoint
predictor works. It achieves performance comparable to the VS Code API
ripgrep globbing, with plain JS. And by using plain JS, we can do more
optimizations in a future PR.

Previously, we had an `ISearchStrategy` type that globbed for all
sourcemap URIs in a target folder, and emitted those. Then the breakpoint
predictor had an mtime-based cache to decide whether it would parse the
sourcemap or not.

This moves the caching responsibility into `ISearchStrategy`, which then
takes a two-phase approach to processing files, allowing it to cache the
intermediate result the breakpoint predictor previously cached itself.

This means that:

- Files never need to be read if their mtime doesn't change
- When starting a new child session, we optimize further and don't stat
  compiled files that didn't previously reference the sourcefile. (We
  still stat all directories to see if there are new files to pick up)

Some performance numbers:

- vscode#167911 time on my computer going from 33s -> 16s
- typescript: time to run mocha tests

The new search strategy can be disabled by setting
`enableTurboSourcemaps: false` in your launch.json.

![](https://media4.giphy.com/media/cRH5deQTgTMR2/giphy.gif?cid=ecf05e47r7gdpd1vzjtyo72z0ymmob3ltfjz7ts4cs64n18i&rid=giphy.gif&ct=g)
connor4312 added a commit to microsoft/vscode-js-debug that referenced this issue Dec 30, 2022
Fixes #1149
Fixes microsoft/vscode#167911

This does some overall system optimization for how the breakpoint
predictor works. It achieves performance comparable to the VS Code API
ripgrep globbing, with plain JS. And by using plain JS, we can do more
optimizations in a future PR.

Previously, we had an `ISearchStrategy` type that globbed for all
sourcemap URIs in a target folder, and emitted those. Then the breakpoint
predictor had an mtime-based cache to decide whether it would parse the
sourcemap or not.

This moves the caching responsibility into `ISearchStrategy`, which then
takes a two-phase approach to processing files, allowing it to cache the
intermediate result the breakpoint predictor previously cached itself.

This means that:

- Files never need to be read if their mtime doesn't change
- When starting a new child session, we optimize further and don't stat
  compiled files that didn't previously reference the sourcefile. (We
  still stat all directories to see if there are new files to pick up)

Some performance numbers:

- vscode#167911 time on my computer going from 33s -> 16s
- typescript: time to run mocha tests 52s -> 22s (without outFiles configured)

The new search strategy can be disabled by setting
`enableTurboSourcemaps: false` in your launch.json.

![](https://media4.giphy.com/media/cRH5deQTgTMR2/giphy.gif?cid=ecf05e47r7gdpd1vzjtyo72z0ymmob3ltfjz7ts4cs64n18i&rid=giphy.gif&ct=g)
connor4312 added a commit to microsoft/vscode-js-debug that referenced this issue Dec 30, 2022
Fixes #1149
Fixes microsoft/vscode#167911

This does some overall system optimization for how the breakpoint
predictor works. It achieves performance comparable to the VS Code API
ripgrep globbing, with plain JS. And by using plain JS, we can do more
optimizations in a future PR.

Previously, we had an `ISearchStrategy` type that globbed for all
sourcemap URIs in a target folder, and emitted those. Then the breakpoint
predictor had an mtime-based cache to decide whether it would parse the
sourcemap or not.

This moves the caching responsibility into `ISearchStrategy`, which then
takes a two-phase approach to processing files, allowing it to cache the
intermediate result the breakpoint predictor previously cached itself.

This means that:

- Files never need to be read if their mtime doesn't change
- When starting a new child session, we optimize further and don't stat
  compiled files that didn't previously reference the sourcefile. (We
  still stat all directories to see if there are new files to pick up)

Some performance numbers:

- vscode#167911 time on my computer going from 33s -> 16s
- typescript: time to run mocha tests 52s -> 22s (without outFiles configured)

The new search strategy can be disabled by setting
`enableTurboSourcemaps: false` in your launch.json.

![](https://media4.giphy.com/media/cRH5deQTgTMR2/giphy.gif?cid=ecf05e47r7gdpd1vzjtyo72z0ymmob3ltfjz7ts4cs64n18i&rid=giphy.gif&ct=g)
@jrieken jrieken added the verified Verification succeeded label Jan 26, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Feb 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues papercut 🩸 A particularly annoying issue impacting someone on the team verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants