-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add PriorityTaskQueue #4144
Merged
Merged
Add PriorityTaskQueue #4144
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tyriar
added a commit
to microsoft/vscode
that referenced
this pull request
Sep 26, 2022
- Optimize critical I/O path for input latency xtermjs/xterm.js#4145 - Add PriorityTaskQueue xtermjs/xterm.js#4144 - Use the browser's IdleDeadline to determine max task time xtermjs/xterm.js#4143 - Defer paused renderer resize to idle callback xtermjs/xterm.js#4142 - Do char atlas warmup via new IdleTaskQueue xtermjs/xterm.js#4141 - Share rgba vars throughout Color.ts, fast setTheme parseColor xtermjs/xterm.js#4140 - Optimize contexts for reading frequently xtermjs/xterm.js#4137 - Fix width of upper 1/8 block char xtermjs/xterm.js#4134 Fixes #161323
@Tyriar Can I use this for the BufferLine resizing? If so, which is the straight forward usage pattern? |
@jerch yes you could use it for that: private _resizeIdleTask: DebouncedIdleTask = new DebouncedIdleTask();
resize(cols, rows) {
// Check if there is room in the buffer or we need a new one immediately
if (cols * CELL_SIZE * 4 > this._data.buffer.byteLength) {
// Discard any pending resizes
this._resizeIdleTask.clear();
// Resize immediately
this._data = ...
} else {
// Swap out the current resize task
this._resizeIdleTask.set(() => cleanUp());
// Resize without reallocating this._data
...
}
} This clean up stuff could be encapsulated within a class for simplicity ( |
5 tasks
lemanschik
pushed a commit
to code-oss-dev/code
that referenced
this pull request
Nov 25, 2022
- Optimize critical I/O path for input latency xtermjs/xterm.js#4145 - Add PriorityTaskQueue xtermjs/xterm.js#4144 - Use the browser's IdleDeadline to determine max task time xtermjs/xterm.js#4143 - Defer paused renderer resize to idle callback xtermjs/xterm.js#4142 - Do char atlas warmup via new IdleTaskQueue xtermjs/xterm.js#4141 - Share rgba vars throughout Color.ts, fast setTheme parseColor xtermjs/xterm.js#4140 - Optimize contexts for reading frequently xtermjs/xterm.js#4137 - Fix width of upper 1/8 block char xtermjs/xterm.js#4134 Fixes microsoft#161323
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This acts as a fallback when idle callbacks aren't supported, we may also want to use it for other tasks (eg. write buffer?)