-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Description
See #4109 (comment)
I think we could actually change this:
xterm.js/src/common/buffer/BufferLine.ts
Lines 335 to 336 in f9db65c
| const data = new Uint32Array(cols * CELL_SIZE); | |
| data.set(this._data.subarray(0, cols * CELL_SIZE)); |
To:
this._data = this._data.subarray(0, cols * CELL_SIZE);That will keep the same ArrayBuffer, but use a different view of it. We wouldn't free the memory but maybe we should only do that either when the view is < 1/2 the size of the buffer, or defer the clean up to an idle timeout? It doesn't make sense to do so many allocations if they're being thrown away immediately after several resizes.
We could do something similar here:
xterm.js/src/common/buffer/BufferLine.ts
Lines 347 to 348 in f9db65c
| this._data = new Uint32Array(0); | |
| this._combined = {}; |