1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00
denoland-deno/tests
carles escrig royo 88a469e823
perf(ext/web): optimize performance.measure() (#25774)
This PR optimizes the case when `performance.measure()` needs to find
the startMark by name. It is a simple change on `findMostRecent` fn to
avoiding copying and reversing the complete entries list.

Adds minor missing tests for:
- `clearMarks()`, general
- `clearMeasures()`, general
- `measure()`, case when the startMarks name exists more than once

### Benchmarks

#### main

```
    CPU | AMD Ryzen 7 PRO 6850U with Radeon Graphics
Runtime | Deno 2.0.0-rc.4 (x86_64-unknown-linux-gnu)

benchmark              time/iter (avg)        iter/s      (min … max)           p75      p99     p995
---------------------- ----------------------------- --------------------- --------------------------
worst case measure()            2.1 ms         486.9 (  1.7 ms …   2.4 ms)   2.2 ms   2.4 ms   2.4 ms
```

#### this PR

```
    CPU | AMD Ryzen 7 PRO 6850U with Radeon Graphics
Runtime | Deno 2.0.0-rc.4 (x86_64-unknown-linux-gnu)

benchmark              time/iter (avg)        iter/s      (min … max)           p75      p99     p995
---------------------- ----------------------------- --------------------- --------------------------
worst case measure()          966.3 µs         1,035 (876.9 µs …   1.1 ms)   1.0 ms   1.1 ms   1.1 ms
```

```ts
Deno.bench("worst case measure()", (b) => {
  performance.mark('start');

  for (let i = 0; i < 1e5; i += 1) {
    performance.mark(crypto.randomUUID());
  }

  b.start();

  performance.measure('total', 'start');

  b.end();

  performance.clearMarks();
  performance.clearMeasures();
});
```
2024-09-20 16:24:59 -07:00
..
config chore: use @std prefix for internal module specifiers (#24543) 2024-07-25 10:26:54 +10:00
ffi feat: suggest deno install --entrypoint instead of deno cache (#25228) 2024-09-18 19:55:50 +00:00
integration refactor(tests): migrate npm itests to specs (#25764) 2024-09-20 22:38:32 +02:00
napi feat: warn when using --allow-run with no allow list (#25215) 2024-09-16 23:08:02 +00:00
node_compat chore: cleanup remaining internals.future code (#25624) 2024-09-16 09:28:35 +10:00
registry fix: cjs resolution cases (#25739) 2024-09-19 21:10:34 -07:00
specs refactor(tests): migrate npm itests to specs (#25764) 2024-09-20 22:38:32 +02:00
testdata refactor(tests): migrate npm itests to specs (#25764) 2024-09-20 22:38:32 +02:00
unit perf(ext/web): optimize performance.measure() (#25774) 2024-09-20 16:24:59 -07:00
unit_node fix(ext/node): support x509 certificates in createPublicKey (#25731) 2024-09-19 19:12:23 +05:30
util chore: update std submodule (#25595) 2024-09-12 22:32:09 +10:00
wpt fix(ext/crypto): ensure EC public keys are exported uncompressed (#25766) 2024-09-20 20:59:05 +05:30
Cargo.toml feat: improve lockfile v4 to store normalized version constraints and be more terse (#25247) 2024-08-28 14:17:47 -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