oxc/crates/oxc_codegen
overlookmotel 8dd76e4780 perf(codegen): reduce size of LineOffsetTable (#4643)
`LineOffsetTables` records mappings from byte offset to line and column numbers (with column number in UTF-16 characters).

Most lines do not contain any Unicode characters, and for these lines there is an exact correspondence between number of bytes from start of line and UTF-16 column number, so no column lookup table is required.

Reduce the data stored for each line from 32 bytes to 8 bytes by storing column offset lookup tables for the rare lines which do contain Unicode chars separately.

Additionally, store column lookup tables as a `Box<[u32]>` instead of `Vec<u32>` to reduce the size of `ColumnOffsets` by 8 bytes.
2024-08-06 01:08:12 +00:00
..
examples refactor(sourcemap)!: avoid passing Results (#4541) 2024-07-30 04:23:49 +00:00
src perf(codegen): reduce size of LineOffsetTable (#4643) 2024-08-06 01:08:12 +00:00
tests/integration fix(codegen): enable more test cases (#4585) 2024-07-31 12:58:28 +00:00
Cargo.toml perf(codegen): reduce size of LineOffsetTable (#4643) 2024-08-06 01:08:12 +00:00
CHANGELOG.md Release crates v0.23.0 (#4595) 2024-08-01 16:55:41 +08:00