Skip to content

initTable is slow, can we lazily load parts as they're needed? #1785

@Tyriar

Description

@Tyriar

On my fairly fast gaming desktop it's over a frame:

image

It looks like initTable could be made so only load chunks of table as necessary, splitting it into 32 parts (66636/32=2048 codepoints) would probably make it have minimal impact on frames following a load.

xterm.js/src/CharWidth.ts

Lines 126 to 131 in cb97ab3

const CODEPOINTS = 65536; // BMP holds 65536 codepoints
const BITWIDTH = 2; // a codepoint can have a width of 0, 1 or 2
const ITEMSIZE = 32; // using uint32_t
const CONTAINERSIZE = CODEPOINTS * BITWIDTH / ITEMSIZE;
const CODEPOINTS_PER_ITEM = ITEMSIZE / BITWIDTH;
table = (typeof Uint32Array === 'undefined')

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions