Files
Daniel Lemire 76ab721fe7 src: reserve simdjson padding in parsePackageJSON
`parsePackageJSON()` copies its input into a `std::string` with no
spare capacity. `simdjson::pad()` then appends `SIMDJSON_PADDING`
spaces, so every call reallocated and copied the whole document.
Reserve room for the padding when the input is copied so that the
append happens in place. The padding stays within the string's size,
so simdjson never reads past the end of the string.

Add a benchmark that parses the package.json files under deps/.

Assisted-by: an AI coding agent
Signed-off-by: Daniel Lemire <daniel@lemire.me>
PR-URL: https://github.com/nodejs/node/pull/67623
Refs: https://github.com/nodejs/node/issues/55584
Refs: https://github.com/nodejs/node/pull/55591
Refs: https://github.com/nodejs/node/pull/67620
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-11-23 12:34:28 +01:00
..