Skip to content

Conversation

SevInf
Copy link
Contributor

@SevInf SevInf commented Mar 11, 2024

Missing bit after #4701

@SevInf SevInf added this to the 5.11.0 milestone Mar 11, 2024
Copy link
Contributor

WASM Size

Engine This PR Base branch Diff
Postgres 2.068MiB 2.068MiB 0.000B
Postgres (gzip) 816.226KiB 816.227KiB -1.000B
Mysql 2.038MiB 2.038MiB 0.000B
Mysql (gzip) 802.604KiB 802.605KiB -1.000B
Sqlite 1.929MiB 1.929MiB 0.000B
Sqlite (gzip) 762.288KiB 762.289KiB -1.000B

Copy link

codspeed-hq bot commented Mar 11, 2024

CodSpeed Performance Report

Merging #4768 will not alter performance

Comparing feat/wasm-psl-all (1291b5d) with main (b1d3505)

Summary

✅ 11 untouched benchmarks

Copy link
Contributor

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

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.1 (x64-linux)

benchmark                   time (avg)             (min … max)       p75       p99      p999
-------------------------------------------------------------- -----------------------------
• movies.findMany() (all - ~50K)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     294 ms/iter       (290 ms … 302 ms)    296 ms    302 ms    302 ms
Web Assembly: Latest       381 ms/iter       (380 ms … 382 ms)    381 ms    382 ms    382 ms
Web Assembly: Current      383 ms/iter       (382 ms … 384 ms)    383 ms    384 ms    384 ms
Node API: Current          197 ms/iter       (196 ms … 199 ms)    199 ms    199 ms    199 ms

summary for movies.findMany() (all - ~50K)
  Web Assembly: Current
   1.94x slower than Node API: Current
   1.3x slower than Web Assembly: Baseline
   1.01x slower than Web Assembly: Latest

• movies.findMany({ take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  11'750 µs/iter (11'433 µs … 14'656 µs) 11'666 µs 14'656 µs 14'656 µs
Web Assembly: Latest    15'146 µs/iter (14'991 µs … 15'427 µs) 15'220 µs 15'427 µs 15'427 µs
Web Assembly: Current   15'382 µs/iter (15'135 µs … 17'754 µs) 15'364 µs 17'754 µs 17'754 µs
Node API: Current        8'188 µs/iter  (7'786 µs … 11'083 µs)  8'175 µs 11'083 µs 11'083 µs

summary for movies.findMany({ take: 2000 })
  Web Assembly: Current
   1.88x slower than Node API: Current
   1.31x slower than Web Assembly: Baseline
   1.02x slower than Web Assembly: Latest

• movies.findMany({ where: {...}, take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1'845 µs/iter   (1'751 µs … 2'652 µs)  1'829 µs  2'531 µs  2'652 µs
Web Assembly: Latest     2'409 µs/iter   (2'314 µs … 3'292 µs)  2'389 µs  3'118 µs  3'292 µs
Web Assembly: Current    2'434 µs/iter   (2'329 µs … 3'136 µs)  2'421 µs  3'082 µs  3'136 µs
Node API: Current        1'400 µs/iter   (1'329 µs … 1'831 µs)  1'401 µs  1'740 µs  1'831 µs

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

• movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     549 ms/iter       (543 ms … 565 ms)    554 ms    565 ms    565 ms
Web Assembly: Latest       739 ms/iter       (736 ms … 749 ms)    743 ms    749 ms    749 ms
Web Assembly: Current      743 ms/iter       (736 ms … 763 ms)    750 ms    763 ms    763 ms
Node API: Current          462 ms/iter       (455 ms … 468 ms)    468 ms    468 ms    468 ms

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

• movies.findMany({ where: {...}, include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  75'577 µs/iter (75'118 µs … 76'471 µs) 76'251 µs 76'471 µs 76'471 µs
Web Assembly: Latest       106 ms/iter       (104 ms … 112 ms)    108 ms    112 ms    112 ms
Web Assembly: Current      107 ms/iter       (106 ms … 107 ms)    107 ms    107 ms    107 ms
Node API: Current       62'491 µs/iter (60'902 µs … 63'524 µs) 63'411 µs 63'524 µs 63'524 µs

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

• movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     970 ms/iter       (963 ms … 994 ms)    972 ms    994 ms    994 ms
Web Assembly: Latest     1'233 ms/iter   (1'229 ms … 1'242 ms)  1'236 ms  1'242 ms  1'242 ms
Web Assembly: Current    1'235 ms/iter   (1'221 ms … 1'265 ms)  1'252 ms  1'265 ms  1'265 ms
Node API: Current          872 ms/iter       (857 ms … 891 ms)    890 ms    891 ms    891 ms

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

• movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     137 ms/iter       (135 ms … 138 ms)    137 ms    138 ms    138 ms
Web Assembly: Latest       174 ms/iter       (172 ms … 176 ms)    176 ms    176 ms    176 ms
Web Assembly: Current      176 ms/iter       (174 ms … 188 ms)    176 ms    188 ms    188 ms
Node API: Current          113 ms/iter       (111 ms … 116 ms)    115 ms    116 ms    116 ms

summary for movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
  Web Assembly: Current
   1.55x slower than Node API: Current
   1.29x 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     864 µs/iter     (811 µs … 1'421 µs)    864 µs  1'306 µs  1'421 µs
Web Assembly: Latest     1'196 µs/iter   (1'125 µs … 1'848 µs)  1'195 µs  1'724 µs  1'848 µs
Web Assembly: Current    1'215 µs/iter   (1'137 µs … 2'319 µs)  1'209 µs  1'817 µs  2'319 µs
Node API: Current          765 µs/iter     (701 µs … 1'102 µs)    791 µs    827 µs  1'102 µs

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

• movie.findMany({ where: { cast: { person: { ... } }, take: 100 }) (m2m -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     857 µs/iter     (809 µs … 1'628 µs)    859 µs  1'257 µs  1'628 µs
Web Assembly: Latest     1'196 µs/iter   (1'125 µs … 2'034 µs)  1'190 µs  1'763 µs  2'034 µs
Web Assembly: Current    1'218 µs/iter   (1'144 µs … 1'810 µs)  1'212 µs  1'778 µs  1'810 µs
Node API: Current          775 µs/iter     (716 µs … 1'110 µs)    795 µs    845 µs  1'110 µs

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

After changes in 1291b5d

@SevInf SevInf requested a review from Weakky March 11, 2024 15:31
@SevInf SevInf marked this pull request as ready for review March 11, 2024 15:32
@SevInf SevInf requested a review from a team as a code owner March 11, 2024 15:32
Copy link
Contributor

@Weakky Weakky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

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