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: add test for upsert failure in relationMode=prisma #4839

Merged
merged 2 commits into from
Apr 24, 2024

Conversation

laplab
Copy link
Contributor

@laplab laplab commented Apr 24, 2024

No description provided.

@laplab laplab self-assigned this Apr 24, 2024
@laplab laplab requested a review from a team as a code owner April 24, 2024 11:37
@laplab laplab requested review from Weakky and removed request for a team April 24, 2024 11:37
Copy link
Contributor

WASM Query Engine file Size

Engine This PR Base branch Diff
Postgres 2.130MiB 2.130MiB 0.000B
Postgres (gzip) 838.792KiB 838.792KiB 1.000B
Mysql 2.098MiB 2.098MiB 0.000B
Mysql (gzip) 825.528KiB 825.527KiB 1.000B
Sqlite 1.991MiB 1.991MiB 0.000B
Sqlite (gzip) 785.920KiB 785.919KiB 1.000B

Copy link

codspeed-hq bot commented Apr 24, 2024

CodSpeed Performance Report

Merging #4839 will not alter performance

Comparing feat/upsert-relation-mode-prisma-test (955dfac) with main (461fac7)

Summary

✅ 11 untouched benchmarks

Copy link
Contributor

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

benchmark                   time (avg)             (min … max)       p75       p99      p999
-------------------------------------------------------------- -----------------------------
• movies.findMany() (all - ~50K)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     379 ms/iter       (372 ms … 384 ms)    382 ms    384 ms    384 ms
Web Assembly: Latest       459 ms/iter       (454 ms … 467 ms)    465 ms    467 ms    467 ms
Web Assembly: Current      464 ms/iter       (461 ms … 469 ms)    468 ms    469 ms    469 ms
Node API: Current          201 ms/iter       (199 ms … 203 ms)    203 ms    203 ms    203 ms

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

• movies.findMany({ take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  15'152 µs/iter (14'816 µs … 17'197 µs) 15'118 µs 17'197 µs 17'197 µs
Web Assembly: Latest    18'690 µs/iter (18'223 µs … 21'225 µs) 18'729 µs 21'225 µs 21'225 µs
Web Assembly: Current   18'790 µs/iter (18'592 µs … 19'036 µs) 18'882 µs 19'036 µs 19'036 µs
Node API: Current        8'151 µs/iter   (7'980 µs … 8'542 µs)  8'195 µs  8'542 µs  8'542 µs

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

• movies.findMany({ where: {...}, take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   2'293 µs/iter   (2'185 µs … 3'441 µs)  2'282 µs  3'031 µs  3'441 µs
Web Assembly: Latest     2'908 µs/iter   (2'757 µs … 4'251 µs)  2'878 µs  4'114 µs  4'251 µs
Web Assembly: Current    2'912 µs/iter   (2'793 µs … 3'728 µs)  2'907 µs  3'659 µs  3'728 µs
Node API: Current        1'448 µs/iter   (1'329 µs … 2'002 µs)  1'448 µs  1'812 µs  2'002 µs

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

• movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     577 ms/iter       (570 ms … 593 ms)    580 ms    593 ms    593 ms
Web Assembly: Latest       781 ms/iter       (775 ms … 803 ms)    782 ms    803 ms    803 ms
Web Assembly: Current      781 ms/iter       (775 ms … 800 ms)    783 ms    800 ms    800 ms
Node API: Current          484 ms/iter       (476 ms … 490 ms)    490 ms    490 ms    490 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  80'373 µs/iter (79'719 µs … 81'348 µs) 80'744 µs 81'348 µs 81'348 µs
Web Assembly: Latest       111 ms/iter       (110 ms … 111 ms)    111 ms    111 ms    111 ms
Web Assembly: Current      111 ms/iter       (110 ms … 112 ms)    112 ms    112 ms    112 ms
Node API: Current       65'171 µs/iter (64'362 µs … 66'458 µs) 65'802 µs 66'458 µs 66'458 µs

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

• movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1'015 ms/iter   (1'012 ms … 1'022 ms)  1'016 ms  1'022 ms  1'022 ms
Web Assembly: Latest     1'302 ms/iter   (1'292 ms … 1'314 ms)  1'307 ms  1'314 ms  1'314 ms
Web Assembly: Current    1'306 ms/iter   (1'295 ms … 1'325 ms)  1'324 ms  1'325 ms  1'325 ms
Node API: Current          884 ms/iter       (863 ms … 894 ms)    893 ms    894 ms    894 ms

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

• movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     145 ms/iter       (143 ms … 146 ms)    145 ms    146 ms    146 ms
Web Assembly: Latest       185 ms/iter       (184 ms … 186 ms)    185 ms    186 ms    186 ms
Web Assembly: Current      186 ms/iter       (185 ms … 187 ms)    187 ms    187 ms    187 ms
Node API: Current          117 ms/iter       (113 ms … 123 ms)    123 ms    123 ms    123 ms

summary for movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
  Web Assembly: Current
   1.6x 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   1'071 µs/iter    (1000 µs … 1'836 µs)  1'067 µs  1'639 µs  1'836 µs
Web Assembly: Latest     1'369 µs/iter   (1'293 µs … 2'139 µs)  1'364 µs  2'023 µs  2'139 µs
Web Assembly: Current    1'387 µs/iter   (1'318 µs … 1'968 µs)  1'387 µs  1'864 µs  1'968 µs
Node API: Current          795 µs/iter     (731 µs … 1'265 µs)    812 µs    893 µs  1'265 µs

summary for movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
  Web Assembly: Current
   1.74x slower than Node API: Current
   1.3x 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   1'039 µs/iter     (980 µs … 1'709 µs)  1'042 µs  1'461 µs  1'709 µs
Web Assembly: Latest     1'384 µs/iter   (1'296 µs … 2'332 µs)  1'377 µs  2'118 µs  2'332 µs
Web Assembly: Current    1'418 µs/iter   (1'330 µs … 2'172 µs)  1'413 µs  2'089 µs  2'172 µs
Node API: Current          781 µs/iter     (727 µs … 1'189 µs)    793 µs    912 µs  1'189 µs

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

After changes in 955dfac

@laplab laplab added this to the 5.14.0 milestone Apr 24, 2024
@laplab laplab merged commit 5d2f494 into main Apr 24, 2024
182 checks passed
@laplab laplab deleted the feat/upsert-relation-mode-prisma-test branch April 24, 2024 14:57
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