mirror of
https://github.com/denoland/deno.git
synced 2024-11-22 15:06:54 -05:00
ceecd8c495
This PR optimizes `structuredClone` when it's called without transferables. ### Benchmarks **main** ``` cpu: 13th Gen Intel(R) Core(TM) i9-13900H runtime: deno 1.37.1 (x86_64-unknown-linux-gnu) benchmark time (avg) iter/s (min … max) p75 p99 p995 ----------------------------------------------------------------------------------- ----------------------------- structuredClone object 1.64 µs/iter 611,086.0 (1.58 µs … 1.84 µs) 1.66 µs 1.84 µs 1.84 µs structuredClone transferables 2.82 µs/iter 354,281.4 (2.78 µs … 2.92 µs) 2.84 µs 2.92 µs 2.92 µs ``` **this PR** ``` cpu: 13th Gen Intel(R) Core(TM) i9-13900H runtime: deno 1.37.1 (x86_64-unknown-linux-gnu) structuredClone object 1 µs/iter 998,383.5 (971.28 ns … 1.2 µs) 1 µs 1.2 µs 1.2 µs structuredClone transferables 2.82 µs/iter 355,087.5 (2.7 µs … 3.07 µs) 2.83 µs 3.07 µs 3.07 µs ``` ```js Deno.bench("structuredClone object", () => { structuredClone({ foo: "bar" }); }); Deno.bench("structuredClone transferables", () => { const buf = new Uint8Array([97]); structuredClone(buf, { transfer: [buf.buffer], }); }); ``` |
||
---|---|---|
.. | ||
benches | ||
00_infra.js | ||
01_dom_exception.js | ||
01_mimesniff.js | ||
02_event.js | ||
02_structured_clone.js | ||
02_timers.js | ||
03_abort_signal.js | ||
04_global_interfaces.js | ||
05_base64.js | ||
06_streams.js | ||
06_streams_types.d.ts | ||
08_text_encoding.js | ||
09_file.js | ||
10_filereader.js | ||
12_location.js | ||
13_message_port.js | ||
14_compression.js | ||
15_performance.js | ||
blob.rs | ||
Cargo.toml | ||
compression.rs | ||
hr_timer_lock.rs | ||
internal.d.ts | ||
lib.deno_web.d.ts | ||
lib.rs | ||
message_port.rs | ||
README.md | ||
stream_resource.rs | ||
timers.rs |
deno web
Op crate that implements Event, TextEncoder, TextDecoder and File API (https://w3c.github.io/FileAPI).
Testing for text encoding is done via WPT in cli/.