prisma-engines icon indicating copy to clipboard operation
prisma-engines copied to clipboard

wip: expose multi-file introspection to cli

Open Weakky opened this issue 1 year ago • 3 comments

DO NOT MERGE

Weakky avatar May 06 '24 09:05 Weakky

WASM Query Engine file Size

Engine This PR Base branch Diff
Postgres 2.141MiB 2.141MiB 0.000B
Postgres (gzip) 842.301KiB 842.302KiB -1.000B
Mysql 2.110MiB 2.110MiB 0.000B
Mysql (gzip) 828.982KiB 828.983KiB -1.000B
Sqlite 2.003MiB 2.003MiB 0.000B
Sqlite (gzip) 789.516KiB 789.517KiB -1.000B

github-actions[bot] avatar May 06 '24 09:05 github-actions[bot]

CodSpeed Performance Report

Merging #4853 will not alter performance

Comparing feat/multi-file-introspection-cli (7d26b05) with feat/multi-file-introspection (b588235)

Summary

✅ 11 untouched benchmarks

codspeed-hq[bot] avatar May 06 '24 09:05 codspeed-hq[bot]

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

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

benchmark                   time (avg)             (min … max)       p75       p99      p999
-------------------------------------------------------------- -----------------------------
• movies.findMany() (all - ~50K)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     370 ms/iter       (365 ms … 377 ms)    374 ms    377 ms    377 ms
Web Assembly: Latest       457 ms/iter       (455 ms … 463 ms)    460 ms    463 ms    463 ms
Web Assembly: Current      456 ms/iter       (453 ms … 459 ms)    459 ms    459 ms    459 ms
Node API: Current          200 ms/iter       (195 ms … 211 ms)    201 ms    211 ms    211 ms

summary for movies.findMany() (all - ~50K)
  Web Assembly: Current
   2.28x slower than Node API: Current
   1.23x slower than Web Assembly: Baseline
   1x faster than Web Assembly: Latest

• movies.findMany({ take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  15'332 µs/iter (14'648 µs … 27'567 µs) 14'884 µs 27'567 µs 27'567 µs
Web Assembly: Latest    18'680 µs/iter (18'158 µs … 21'676 µs) 18'753 µs 21'676 µs 21'676 µs
Web Assembly: Current   18'452 µs/iter (18'147 µs … 19'715 µs) 18'569 µs 19'715 µs 19'715 µs
Node API: Current        8'061 µs/iter   (7'856 µs … 8'362 µs)  8'097 µs  8'362 µs  8'362 µs

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

• movies.findMany({ where: {...}, take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   2'375 µs/iter   (2'206 µs … 4'457 µs)  2'293 µs  4'426 µs  4'457 µs
Web Assembly: Latest     2'888 µs/iter   (2'775 µs … 4'382 µs)  2'863 µs  3'564 µs  4'382 µs
Web Assembly: Current    2'887 µs/iter   (2'782 µs … 3'670 µs)  2'862 µs  3'576 µs  3'670 µs
Node API: Current        1'392 µs/iter   (1'302 µs … 1'803 µs)  1'406 µs  1'691 µs  1'803 µs

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

• movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     572 ms/iter       (565 ms … 587 ms)    574 ms    587 ms    587 ms
Web Assembly: Latest       781 ms/iter       (774 ms … 801 ms)    784 ms    801 ms    801 ms
Web Assembly: Current      782 ms/iter       (778 ms … 790 ms)    789 ms    790 ms    790 ms
Node API: Current          475 ms/iter       (466 ms … 481 ms)    479 ms    481 ms    481 ms

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

• movies.findMany({ where: {...}, include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  79'352 µs/iter (78'948 µs … 79'792 µs) 79'745 µs 79'792 µs 79'792 µs
Web Assembly: Latest       111 ms/iter       (110 ms … 113 ms)    112 ms    113 ms    113 ms
Web Assembly: Current      111 ms/iter       (110 ms … 112 ms)    112 ms    112 ms    112 ms
Node API: Current       62'053 µs/iter (60'990 µs … 62'840 µs) 62'703 µs 62'840 µs 62'840 µs

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

• movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1'018 ms/iter   (1'009 ms … 1'035 ms)  1'033 ms  1'035 ms  1'035 ms
Web Assembly: Latest     1'296 ms/iter   (1'288 ms … 1'311 ms)  1'303 ms  1'311 ms  1'311 ms
Web Assembly: Current    1'303 ms/iter   (1'291 ms … 1'326 ms)  1'324 ms  1'326 ms  1'326 ms
Node API: Current          868 ms/iter       (857 ms … 881 ms)    878 ms    881 ms    881 ms

summary for movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
  Web Assembly: Current
   1.5x slower than Node API: Current
   1.28x 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     144 ms/iter       (143 ms … 146 ms)    144 ms    146 ms    146 ms
Web Assembly: Latest       185 ms/iter       (181 ms … 194 ms)    187 ms    194 ms    194 ms
Web Assembly: Current      187 ms/iter       (185 ms … 188 ms)    188 ms    188 ms    188 ms
Node API: Current          110 ms/iter       (108 ms … 112 ms)    111 ms    112 ms    112 ms

summary for movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
  Web Assembly: Current
   1.7x slower than Node API: Current
   1.3x 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   1'042 µs/iter     (980 µs … 1'821 µs)  1'035 µs  1'580 µs  1'821 µs
Web Assembly: Latest     1'364 µs/iter   (1'298 µs … 1'906 µs)  1'365 µs  1'829 µs  1'906 µs
Web Assembly: Current    1'391 µs/iter   (1'313 µs … 2'217 µs)  1'384 µs  1'906 µs  2'217 µs
Node API: Current          782 µs/iter     (712 µs … 1'177 µs)    806 µs    927 µs  1'177 µs

summary for movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
  Web Assembly: Current
   1.78x slower than Node API: Current
   1.33x 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   1'037 µs/iter     (984 µs … 1'725 µs)  1'033 µs  1'674 µs  1'725 µs
Web Assembly: Latest     1'379 µs/iter   (1'304 µs … 1'896 µs)  1'387 µs  1'825 µs  1'896 µs
Web Assembly: Current    1'396 µs/iter   (1'314 µs … 2'378 µs)  1'388 µs  2'045 µs  2'378 µs
Node API: Current          801 µs/iter     (724 µs … 1'246 µs)    819 µs    930 µs  1'246 µs

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

After changes in 7d26b0598b5920d22bd83f2c087c7b06cfda7fec

github-actions[bot] avatar May 06 '24 09:05 github-actions[bot]