oxc/crates/oxc_sourcemap
Brooooooklyn 1fd9dd0388
perf(sourcemap): use simd to escape JSON string (#4487)
Also optimize the memory allocation in string escape. The default size in `serde_json` is 1024 for String type, we pre allocate `string.len() * 2 + 2` for every string to reduce re-allocate in escaping.

I've tried to hand write SIMD implementation, but it's too complex, so I uses the `v_jsonescape` here. But it doesn't support `aarch64` and `wasm32` simd implementation, we need to contribute to it!
2024-07-29 12:42:21 +00:00
..
src perf(sourcemap): use simd to escape JSON string (#4487) 2024-07-29 12:42:21 +00:00
Cargo.toml Release crates v0.22.1 (#4508) 2024-07-28 09:58:29 +08:00
CHANGELOG.md Release crates v0.22.1 (#4508) 2024-07-28 09:58:29 +08:00
README.md feat: add oxc sourcemap crate (#2825) 2024-03-28 19:36:38 +08:00

The sourcemap implement port from rust-sourcemap, but has some different with it.

  • Encode sourcemap at parallel, including quote sourceContent and encode token to vlq mappings.
  • Avoid Sourcemap some methods overhead, like SourceMap::tokens().