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

feat(shadow-database): Drop shadow database WITH (FORCE) for PostgreSQL #4282

Closed
wants to merge 4 commits into from

Conversation

janpio
Copy link
Contributor

@janpio janpio commented Sep 26, 2023

No description provided.

@janpio janpio requested a review from a team as a code owner September 26, 2023 08:37
@codspeed-hq
Copy link

codspeed-hq bot commented Sep 26, 2023

CodSpeed Performance Report

Merging #4282 will not alter performance

Comparing janpio/shadow-drop-with-force (bded175) with main (c2e5bf2)

Summary

✅ 11 untouched benchmarks

@janpio janpio marked this pull request as draft September 29, 2023 11:37
Copy link
Contributor

WASM Size

Engine This PR Base branch Diff
WASM 2.329MiB 2.329MiB 0.000B
WASM (gzip) 906.378KiB 906.378KiB 0.000B

Copy link
Contributor

github-actions bot commented Jan 25, 2024

✅ WASM query-engine performance won't change substantially (1.006x)

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      p999
-------------------------------------------------------------- -----------------------------
• movies.findMany() (all - 25000)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  303.75 ms/iter  (301.3 ms … 308.48 ms) 308.26 ms 308.48 ms 308.48 ms
Web Assembly: Latest    363.87 ms/iter (363.09 ms … 366.41 ms) 364.15 ms 366.41 ms 366.41 ms
Web Assembly: Current   367.51 ms/iter (366.65 ms … 368.43 ms) 368.07 ms 368.43 ms 368.43 ms
Node API: Current       229.92 ms/iter (225.43 ms … 238.65 ms) 232.85 ms 238.65 ms 238.65 ms

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

• movies.findMany({ take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   12.32 ms/iter   (12.12 ms … 13.67 ms)  12.26 ms  13.67 ms  13.67 ms
Web Assembly: Latest     14.87 ms/iter   (14.71 ms … 16.28 ms)  14.82 ms  16.28 ms  16.28 ms
Web Assembly: Current    14.95 ms/iter    (14.83 ms … 15.6 ms)  14.96 ms   15.6 ms   15.6 ms
Node API: Current        8,798 µs/iter   (8,644 µs … 9,180 µs)  8,829 µs  9,180 µs  9,180 µs

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

• movies.findMany({ where: {...}, take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1,954 µs/iter   (1,848 µs … 3,133 µs)  1,931 µs  2,865 µs  3,133 µs
Web Assembly: Latest     2,412 µs/iter   (2,251 µs … 3,984 µs)  2,366 µs  3,792 µs  3,984 µs
Web Assembly: Current    2,378 µs/iter   (2,270 µs … 3,459 µs)  2,354 µs  3,444 µs  3,459 µs
Node API: Current        1,509 µs/iter   (1,405 µs … 1,954 µs)  1,518 µs  1,738 µs  1,954 µs

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

• movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   12.15 ms/iter   (12.03 ms … 12.92 ms)  12.14 ms  12.92 ms  12.92 ms
Web Assembly: Latest     14.74 ms/iter   (14.68 ms … 14.88 ms)  14.77 ms  14.88 ms  14.88 ms
Web Assembly: Current    14.87 ms/iter   (14.78 ms … 15.17 ms)   14.9 ms  15.17 ms  15.17 ms
Node API: Current        8,798 µs/iter   (8,678 µs … 9,009 µs)  8,833 µs  9,009 µs  9,009 µs

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

• movies.findMany({ where: {...}, include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1,899 µs/iter   (1,839 µs … 2,741 µs)  1,902 µs  2,279 µs  2,741 µs
Web Assembly: Latest     2,302 µs/iter   (2,235 µs … 3,239 µs)  2,306 µs  2,640 µs  3,239 µs
Web Assembly: Current    2,311 µs/iter   (2,252 µs … 2,852 µs)  2,315 µs  2,631 µs  2,852 µs
Node API: Current        1,497 µs/iter   (1,397 µs … 1,926 µs)  1,513 µs  1,718 µs  1,926 µs

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

• movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   12.18 ms/iter   (12.08 ms … 12.31 ms)  12.22 ms  12.31 ms  12.31 ms
Web Assembly: Latest     14.75 ms/iter   (14.63 ms … 15.36 ms)  14.78 ms  15.36 ms  15.36 ms
Web Assembly: Current    14.87 ms/iter   (14.75 ms … 15.09 ms)  14.91 ms  15.09 ms  15.09 ms
Node API: Current        8,939 µs/iter   (8,691 µs … 9,341 µs)  9,041 µs  9,341 µs  9,341 µs

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

• movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1,886 µs/iter   (1,814 µs … 2,294 µs)  1,893 µs  2,201 µs  2,294 µs
Web Assembly: Latest     2,297 µs/iter   (2,242 µs … 2,659 µs)  2,305 µs  2,528 µs  2,659 µs
Web Assembly: Current    2,316 µs/iter   (2,259 µs … 2,784 µs)  2,314 µs  2,606 µs  2,784 µs
Node API: Current        1,494 µs/iter   (1,432 µs … 1,694 µs)  1,509 µs  1,668 µs  1,694 µs

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

• movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  897.21 µs/iter  (845.25 µs … 1,507 µs)    897 µs  1,373 µs  1,507 µs
Web Assembly: Latest     1,134 µs/iter   (1,097 µs … 1,817 µs)  1,138 µs  1,342 µs  1,817 µs
Web Assembly: Current    1,142 µs/iter   (1,108 µs … 1,680 µs)  1,148 µs  1,343 µs  1,680 µs
Node API: Current       812.76 µs/iter  (745.64 µs … 974.9 µs) 827.51 µs 908.84 µs  974.9 µs

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

• movie.findMany({ where: { cast: { person: { ... } }, take: 100 }) (m2m -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  902.21 µs/iter  (853.38 µs … 1,601 µs) 905.62 µs  1,251 µs  1,601 µs
Web Assembly: Latest     1,114 µs/iter   (1,075 µs … 1,389 µs)  1,124 µs  1,297 µs  1,389 µs
Web Assembly: Current    1,121 µs/iter   (1,084 µs … 1,417 µs)  1,129 µs  1,325 µs  1,417 µs
Node API: Current       821.22 µs/iter  (741.79 µs … 1,013 µs) 835.16 µs 954.07 µs  1,013 µs

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

After changes in bded175

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.

1 participant