refactor(core): Improve ergonomics of managing ASCII strings (#18498)

This is a follow-on to the earlier work in reducing string copies,
mainly focused on ensuring that ASCII strings are easy to provide to the
JS runtime.

While we are replacing a 16-byte reference in a number of places with a
24-byte structure (measured via `std::mem::size_of`), the reduction in
copies wins out over the additional size of the arguments passed into
functions.

Benchmarking shows approximately the same if not slightly less wallclock
time/instructions retired, but I believe this continues to open up
further refactoring opportunities.
This commit is contained in:
Matt Mastracci 2023-04-04 06:46:31 -06:00 committed by GitHub
parent 2dc2016837
commit a1764f7690
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 817 additions and 641 deletions

View file

@ -22,7 +22,7 @@ mod tests {
..Default::default()
});
js_runtime
.execute_script(
.execute_script_static(
"<anon>",
r#"
if (!(bootstrap.mainRuntime && bootstrap.workerRuntime)) {