diff options
author | Matt Mastracci <matthew@mastracci.com> | 2023-04-04 06:46:31 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-04 06:46:31 -0600 |
commit | a1764f7690cfdc3e42724fcad29ef954b7e576a4 (patch) | |
tree | 1b621ebd7a6ef50687eeb2061740895096136e8a /core/examples/schedule_task.rs | |
parent | 2dc20168371e827b86e2ce0d1d7787139fba68f3 (diff) |
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.
Diffstat (limited to 'core/examples/schedule_task.rs')
-rw-r--r-- | core/examples/schedule_task.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/examples/schedule_task.rs b/core/examples/schedule_task.rs index 42d00022d..348ba7666 100644 --- a/core/examples/schedule_task.rs +++ b/core/examples/schedule_task.rs @@ -50,7 +50,7 @@ fn main() { let future = async move { // Schedule 10 tasks. js_runtime - .execute_script( + .execute_script_static( "<usage>", r#"for (let i = 1; i <= 10; i++) Deno.core.ops.op_schedule_task(i);"#, ) |