1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-21 23:04:45 -05:00
denoland-deno/tests
Divy Srivastava 1ba88a7892
perf(ext/node): improve Buffer from string performance (#24567)
Fixes https://github.com/denoland/deno/issues/24323

- Use a Buffer pool for `fromString`
- Implement fast call base64 writes
- Direct from string `create` method for each encoding op

```
$ deno bench -A bench.mjs # 1.45.1+fee4d3a
cpu: Apple M1 Pro
runtime: deno 1.45.1+fee4d3a (aarch64-apple-darwin)

benchmark                time (avg)             (min … max)       p75       p99      p999
----------------------------------------------------------- -----------------------------
Buffer.from base64      550 ns/iter     (490 ns … 1'265 ns)    572 ns    606 ns  1'265 ns
Buffer#write base64     285 ns/iter       (259 ns … 371 ns)    307 ns    347 ns    360 ns

$ ~/gh/deno/target/release/deno bench -A bench.mjs # this PR
cpu: Apple M1 Pro
runtime: deno dev (aarch64-apple-darwin)

benchmark                time (avg)             (min … max)       p75       p99      p999
----------------------------------------------------------- -----------------------------
Buffer.from base64      151 ns/iter       (145 ns … 770 ns)    148 ns    184 ns    648 ns
Buffer#write base64   62.58 ns/iter     (60.79 ns … 157 ns)  61.65 ns  75.79 ns    141 ns

$ node bench.mjs # v22.4.0
cpu: Apple M1 Pro
runtime: node v22.4.0 (arm64-darwin)

benchmark                time (avg)             (min … max)       p75       p99      p999
----------------------------------------------------------- -----------------------------
Buffer.from base64      163 ns/iter     (96.92 ns … 375 ns)  99.45 ns    127 ns    220 ns
Buffer#write base64   75.48 ns/iter     (74.97 ns … 134 ns)  75.17 ns  81.83 ns  96.84 ns
```
2024-07-30 18:09:55 +05:30
..
config chore: use @std prefix for internal module specifiers (#24543) 2024-07-25 10:26:54 +10:00
ffi chore: update to std@2024.07.19 (#24715) 2024-07-25 15:30:28 +10:00
integration chore: mark upgrade invalid lockfile as flaky (#24760) 2024-07-29 16:18:25 -04:00
napi chore: update to std@2024.07.19 (#24715) 2024-07-25 15:30:28 +10:00
node_compat fix(node/worker_threads): support port.once() (#24725) 2024-07-25 23:06:19 +02:00
registry fix(ext/node): do not expose self global in node (#24637) 2024-07-19 12:37:08 +09:00
specs fix(http): Adjust hostname display for Windows when using 0.0.0.0 (#24698) 2024-07-28 23:04:05 +02:00
testdata fix(publish): workspace included license file had incorrect path (#24747) 2024-07-26 15:35:29 +00:00
unit fix(http): Adjust hostname display for Windows when using 0.0.0.0 (#24698) 2024-07-28 23:04:05 +02:00
unit_node perf(ext/node): improve Buffer from string performance (#24567) 2024-07-30 18:09:55 +05:30
util chore: upgrade to rust 1.80 (#24778) 2024-07-29 12:58:04 -04:00
wpt chore: update to std@2024.07.19 (#24715) 2024-07-25 15:30:28 +10:00
Cargo.toml chore: upgrade to rust 1.80 (#24778) 2024-07-29 12:58:04 -04:00
lib.rs chore: move cli/tests/ -> tests/ (#22369) 2024-02-10 20:22:13 +00:00
README.md chore: continue tests/ re-org (#22396) 2024-02-12 17:13:14 -07:00

Deno Integration Tests