Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qe-wasm: Add script for twiggy visualisation #4607

Merged
merged 1 commit into from
Dec 26, 2023
Merged

Conversation

SevInf
Copy link
Contributor

@SevInf SevInf commented Dec 22, 2023

Usage: node visualiz-twiggy.mjs
Produces result.html file with output of twiggy dominators with the
collabsible sections.

Usage: `node visualiz-twiggy.mjs`
Produces result.html file with output of `twiggy dominators` with the
collabsible sections.
@SevInf SevInf requested a review from a team as a code owner December 22, 2023 14:23
@SevInf SevInf requested review from jkomyno and Druue and removed request for a team December 22, 2023 14:23
Copy link
Contributor

WASM Size

Engine This PR Base branch Diff
WASM 2.866MiB 2.866MiB 0.000B
WASM (gzip) 1.055MiB 1.055MiB 0.000B

Copy link

codspeed-hq bot commented Dec 22, 2023

CodSpeed Performance Report

Merging #4607 will not alter performance

Comparing feat/visualize-script (fee9062) with main (dbb3fbf)

Summary

✅ 11 untouched benchmarks

Copy link
Contributor

✅ WASM query-engine: no benchmarks have regressed

Full benchmark report
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/bench?schema=imdb_bench&sslmode=disable" \
node --experimental-wasm-modules query-engine/driver-adapters/executor/dist/bench.mjs
cpu: AMD EPYC 7763 64-Core Processor
runtime: node v18.19.0 (x64-linux)

benchmark                   time (avg)             (min … max)       p75       p99      p995
-------------------------------------------------------------- -----------------------------
• movies.findMany() (all - 25000)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  309.01 ms/iter (302.65 ms … 322.47 ms) 309.73 ms 322.47 ms 322.47 ms
Web Assembly: Latest     312.6 ms/iter (309.55 ms … 319.33 ms) 313.62 ms 319.33 ms 319.33 ms
Web Assembly: Current   308.72 ms/iter (303.04 ms … 314.53 ms) 310.39 ms 314.53 ms 314.53 ms
Node API: Current       234.68 ms/iter (229.14 ms … 245.73 ms) 235.86 ms 245.73 ms 245.73 ms

summary for movies.findMany() (all - 25000)
  Web Assembly: Current
   1.32x slower than Node API: Current
   1x faster than Web Assembly: Baseline
   1.01x faster than Web Assembly: Latest

• movies.findMany({ take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   13.04 ms/iter   (11.79 ms … 22.14 ms)  12.36 ms  22.14 ms  22.14 ms
Web Assembly: Latest     12.46 ms/iter   (12.09 ms … 14.93 ms)   12.3 ms  14.93 ms  14.93 ms
Web Assembly: Current    12.29 ms/iter   (11.85 ms … 16.56 ms)  12.27 ms  16.56 ms  16.56 ms
Node API: Current         9.51 ms/iter    (9.19 ms … 12.59 ms)    9.6 ms  12.59 ms  12.59 ms

summary for movies.findMany({ take: 2000 })
  Web Assembly: Current
   1.29x slower than Node API: Current
   1.01x faster than Web Assembly: Latest
   1.06x faster than Web Assembly: Baseline

• movies.findMany({ where: {...}, take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline    2.06 ms/iter     (1.83 ms … 3.59 ms)   1.94 ms   3.45 ms    3.5 ms
Web Assembly: Latest      1.98 ms/iter      (1.83 ms … 3.8 ms)   1.93 ms   3.38 ms    3.4 ms
Web Assembly: Current     1.93 ms/iter     (1.83 ms … 3.71 ms)    1.9 ms    2.9 ms      3 ms
Node API: Current         1.58 ms/iter     (1.49 ms … 2.15 ms)   1.59 ms   1.93 ms   2.12 ms

summary for movies.findMany({ where: {...}, take: 2000 })
  Web Assembly: Current
   1.22x slower than Node API: Current
   1.03x faster than Web Assembly: Latest
   1.07x faster than Web Assembly: Baseline

• movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   12.52 ms/iter   (11.76 ms … 17.24 ms)  12.38 ms  17.24 ms  17.24 ms
Web Assembly: Latest     12.26 ms/iter   (12.09 ms … 13.01 ms)  12.26 ms  13.01 ms  13.01 ms
Web Assembly: Current    12.21 ms/iter   (11.94 ms … 12.66 ms)  12.29 ms  12.66 ms  12.66 ms
Node API: Current         9.38 ms/iter     (9.12 ms … 9.78 ms)   9.41 ms   9.78 ms   9.78 ms

summary for movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
  Web Assembly: Current
   1.3x slower than Node API: Current
   1x faster than Web Assembly: Latest
   1.03x faster than Web Assembly: Baseline

• movies.findMany({ where: {...}, include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline    1.92 ms/iter     (1.82 ms … 3.13 ms)    1.9 ms   2.81 ms   2.84 ms
Web Assembly: Latest      1.88 ms/iter     (1.82 ms … 2.55 ms)   1.88 ms   2.26 ms   2.38 ms
Web Assembly: Current     1.89 ms/iter     (1.83 ms … 3.05 ms)   1.89 ms   2.26 ms   2.38 ms
Node API: Current         1.59 ms/iter     (1.52 ms … 2.31 ms)    1.6 ms    1.8 ms   1.84 ms

summary for movies.findMany({ where: {...}, include: { cast: true } take: 2000 }) (m2m)
  Web Assembly: Current
   1.19x slower than Node API: Current
   1.01x slower than Web Assembly: Latest
   1.01x faster than Web Assembly: Baseline

• movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   12.13 ms/iter    (11.8 ms … 14.06 ms)  12.17 ms  14.06 ms  14.06 ms
Web Assembly: Latest     12.24 ms/iter   (12.06 ms … 13.89 ms)  12.25 ms  13.89 ms  13.89 ms
Web Assembly: Current    12.25 ms/iter   (11.98 ms … 12.52 ms)  12.35 ms  12.52 ms  12.52 ms
Node API: Current         9.41 ms/iter     (9.09 ms … 9.72 ms)   9.47 ms   9.72 ms   9.72 ms

summary for movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
  Web Assembly: Current
   1.3x slower than Node API: Current
   1.01x slower than Web Assembly: Baseline
   1x faster than Web Assembly: Latest

• movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline    1.91 ms/iter     (1.81 ms … 2.73 ms)   1.91 ms   2.65 ms   2.72 ms
Web Assembly: Latest      1.91 ms/iter     (1.82 ms … 2.94 ms)    1.9 ms   2.81 ms   2.84 ms
Web Assembly: Current     1.91 ms/iter     (1.84 ms … 2.54 ms)    1.9 ms   2.34 ms   2.42 ms
Node API: Current         1.66 ms/iter     (1.52 ms … 2.66 ms)   1.63 ms   2.44 ms   2.54 ms

summary for movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
  Web Assembly: Current
   1.15x slower than Node API: Current
   1x faster than Web Assembly: Latest
   1x faster than Web Assembly: Baseline

• movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  951.45 µs/iter   (860.35 µs … 1.69 ms) 934.97 µs   1.55 ms   1.58 ms
Web Assembly: Latest     910.5 µs/iter   (849.75 µs … 5.42 ms) 902.81 µs   1.23 ms    1.4 ms
Web Assembly: Current   908.77 µs/iter   (852.66 µs … 1.55 ms) 906.64 µs    1.4 ms   1.46 ms
Node API: Current        820.8 µs/iter    (770.74 µs … 1.1 ms) 840.64 µs 931.32 µs 984.95 µs

summary for movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
  Web Assembly: Current
   1.11x slower than Node API: Current
   1x faster than Web Assembly: Latest
   1.05x faster than Web Assembly: Baseline

• movie.findMany({ where: { cast: { person: { ... } }, take: 100 }) (m2m -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  917.84 µs/iter   (861.96 µs … 1.44 ms) 916.67 µs    1.3 ms   1.39 ms
Web Assembly: Latest    891.18 µs/iter   (851.97 µs … 1.37 ms) 899.36 µs   1.17 ms    1.2 ms
Web Assembly: Current   904.09 µs/iter    (861.79 µs … 1.6 ms) 899.32 µs   1.53 ms   1.54 ms
Node API: Current       824.25 µs/iter   (772.82 µs … 1.12 ms) 845.63 µs 997.43 µs   1.05 ms

summary for movie.findMany({ where: { cast: { person: { ... } }, take: 100 }) (m2m -> to-one)
  Web Assembly: Current
   1.1x slower than Node API: Current
   1.01x slower than Web Assembly: Latest
   1.02x faster than Web Assembly: Baseline

After changes in fee9062

@SevInf SevInf added this to the 5.8.0 milestone Dec 22, 2023
@jkomyno
Copy link
Contributor

jkomyno commented Dec 26, 2023

Example output:

Screenshot 2023-12-26 at 12 21 38

@jkomyno jkomyno merged commit 6c16595 into main Dec 26, 2023
112 checks passed
@jkomyno jkomyno deleted the feat/visualize-script branch December 26, 2023 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants