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

chore(libquery): remove dmmf #4790

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

chore(libquery): remove dmmf #4790

wants to merge 2 commits into from

Conversation

jkomyno
Copy link
Contributor

@jkomyno jkomyno commented Mar 25, 2024

This PR removes the dmmf method from the libquery query engine.
Context: during a conversation with @SevInf on Slack, it turned out that this dmmf method was never called by @prisma/client.

/integration

@jkomyno jkomyno self-assigned this Mar 25, 2024
@jkomyno jkomyno added this to the 5.12.0 milestone Mar 25, 2024
Copy link
Contributor

WASM Size

Engine This PR Base branch Diff
Postgres 2.068MiB 2.068MiB 0.000B
Postgres (gzip) 816.206KiB 816.206KiB 0.000B
Mysql 2.038MiB 2.038MiB 0.000B
Mysql (gzip) 802.601KiB 802.601KiB 0.000B
Sqlite 1.929MiB 1.929MiB 0.000B
Sqlite (gzip) 762.329KiB 762.329KiB 0.000B

Copy link

codspeed-hq bot commented Mar 25, 2024

CodSpeed Performance Report

Merging #4790 will not alter performance

Comparing feat/qe-remove-dmmf (0ee5905) with main (ac6cd78)

Summary

✅ 11 untouched benchmarks

Copy link
Contributor

❌ WASM query-engine performance will worsen by 1.83%

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     291 ms/iter       (288 ms … 294 ms)    294 ms    294 ms    294 ms
Web Assembly: Latest       376 ms/iter       (372 ms … 389 ms)    378 ms    389 ms    389 ms
Web Assembly: Current      382 ms/iter       (381 ms … 386 ms)    384 ms    386 ms    386 ms
Node API: Current          195 ms/iter       (192 ms … 201 ms)    196 ms    201 ms    201 ms

summary for movies.findMany() (all - ~50K)
  Web Assembly: Current
   1.96x slower than Node API: Current
   1.31x slower than Web Assembly: Baseline
   1.02x slower than Web Assembly: Latest

• movies.findMany({ take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  11'945 µs/iter (11'509 µs … 14'369 µs) 11'680 µs 14'369 µs 14'369 µs
Web Assembly: Latest    15'025 µs/iter (14'877 µs … 15'428 µs) 15'062 µs 15'428 µs 15'428 µs
Web Assembly: Current   16'230 µs/iter (15'063 µs … 26'713 µs) 15'285 µs 26'713 µs 26'713 µs
Node API: Current        7'953 µs/iter   (7'820 µs … 8'256 µs)  7'992 µs  8'256 µs  8'256 µs

summary for movies.findMany({ take: 2000 })
  Web Assembly: Current
   2.04x slower than Node API: Current
   1.36x slower than Web Assembly: Baseline
   1.08x slower than Web Assembly: Latest

• movies.findMany({ where: {...}, take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1'845 µs/iter   (1'763 µs … 2'724 µs)  1'842 µs  2'547 µs  2'724 µs
Web Assembly: Latest     2'379 µs/iter   (2'294 µs … 3'307 µs)  2'373 µs  3'027 µs  3'307 µs
Web Assembly: Current    2'416 µs/iter   (2'328 µs … 3'205 µs)  2'406 µs  2'943 µs  3'205 µs
Node API: Current        1'394 µs/iter   (1'317 µs … 1'832 µs)  1'398 µs  1'690 µs  1'832 µs

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

• movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     554 ms/iter       (546 ms … 577 ms)    553 ms    577 ms    577 ms
Web Assembly: Latest       738 ms/iter       (732 ms … 756 ms)    740 ms    756 ms    756 ms
Web Assembly: Current      740 ms/iter       (733 ms … 757 ms)    741 ms    757 ms    757 ms
Node API: Current          459 ms/iter       (448 ms … 481 ms)    470 ms    481 ms    481 ms

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

• movies.findMany({ where: {...}, include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  76'497 µs/iter (76'005 µs … 77'041 µs) 76'900 µs 77'041 µs 77'041 µs
Web Assembly: Latest       105 ms/iter       (105 ms … 106 ms)    106 ms    106 ms    106 ms
Web Assembly: Current      103 ms/iter       (103 ms … 104 ms)    103 ms    104 ms    104 ms
Node API: Current       60'902 µs/iter (59'981 µs … 62'161 µs) 62'021 µs 62'161 µs 62'161 µs

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

• movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     974 ms/iter       (968 ms … 999 ms)    972 ms    999 ms    999 ms
Web Assembly: Latest     1'230 ms/iter   (1'224 ms … 1'244 ms)  1'234 ms  1'244 ms  1'244 ms
Web Assembly: Current    1'237 ms/iter   (1'228 ms … 1'252 ms)  1'250 ms  1'252 ms  1'252 ms
Node API: Current          875 ms/iter       (859 ms … 894 ms)    883 ms    894 ms    894 ms

summary for movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
  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: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     140 ms/iter       (137 ms … 141 ms)    141 ms    141 ms    141 ms
Web Assembly: Latest       173 ms/iter       (172 ms … 176 ms)    175 ms    176 ms    176 ms
Web Assembly: Current      174 ms/iter       (172 ms … 177 ms)    176 ms    177 ms    177 ms
Node API: Current          111 ms/iter       (108 ms … 114 ms)    114 ms    114 ms    114 ms

summary for movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
  Web Assembly: Current
   1.56x slower than Node API: Current
   1.25x 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     877 µs/iter     (813 µs … 2'493 µs)    872 µs  1'358 µs  2'493 µs
Web Assembly: Latest     1'203 µs/iter   (1'124 µs … 1'892 µs)  1'198 µs  1'791 µs  1'892 µs
Web Assembly: Current    1'254 µs/iter   (1'148 µs … 2'212 µs)  1'215 µs  2'158 µs  2'212 µs
Node API: Current          771 µs/iter     (743 µs … 1'125 µs)    784 µs    818 µs  1'125 µs

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

• movie.findMany({ where: { cast: { person: { ... } }, take: 100 }) (m2m -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     847 µs/iter     (809 µs … 1'513 µs)    853 µs  1'100 µs  1'513 µs
Web Assembly: Latest     1'187 µs/iter   (1'124 µs … 1'833 µs)  1'185 µs  1'741 µs  1'833 µs
Web Assembly: Current    1'202 µs/iter   (1'153 µs … 1'702 µs)  1'210 µs  1'525 µs  1'702 µs
Node API: Current          768 µs/iter     (711 µs … 1'175 µs)    785 µs    921 µs  1'175 µs

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

After changes in 0ee5905

@jkomyno
Copy link
Contributor Author

jkomyno commented Mar 25, 2024

❌ WASM query-engine performance will worsen by 1.83%

Full benchmark report
After changes in 0ee5905

This report doesn't make any sense. Wasm Query Engine isn't affected at all by this PR.

@Jolg42 Jolg42 modified the milestones: 5.12.0, 5.13.0 Apr 2, 2024
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.

None yet

2 participants