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

Reduce unnecessary calls to PtyService #185389

Merged
merged 3 commits into from
Jun 22, 2023
Merged

Reduce unnecessary calls to PtyService #185389

merged 3 commits into from
Jun 22, 2023

Conversation

Tyriar
Copy link
Member

@Tyriar Tyriar commented Jun 16, 2023

This speeds up profile resolving/terminal startup:

  • PtyService.getEnvironment is only called a single time as the value shouldn't change
  • PtyService.resize is never called using the same args consecutively (per terminal)

Part of #133542
Fixes #185379

@Tyriar Tyriar added this to the June 2023 milestone Jun 16, 2023
@Tyriar Tyriar requested a review from meganrogge June 16, 2023 22:09
@Tyriar Tyriar self-assigned this Jun 16, 2023
});
}

resize(cols: number, rows: number): void {
if (this._inReplay) {
if (this._inReplay || this._lastDimensions.cols === cols && this._lastDimensions.rows === rows) {
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, will keep my eye out for issues, i wonder if this could go wrong

Copy link
Member Author

Choose a reason for hiding this comment

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

Since there should only ever be a single window attached, it should stay in sync

@Tyriar Tyriar merged commit df36085 into main Jun 22, 2023
7 checks passed
@Tyriar Tyriar deleted the tyriar/fname__calls branch June 22, 2023 00:18
@github-actions github-actions bot locked and limited conversation to collaborators Aug 6, 2023
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.

PtyService.getEnvironment is called excessively on startup
2 participants