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

test(driver-adapters): fix / uncomment tests #4738

Merged
merged 6 commits into from
Feb 28, 2024
Merged

Conversation

jkomyno
Copy link
Contributor

@jkomyno jkomyno commented Feb 15, 2024

This PR contributes to https://github.com/prisma/team-orm/issues/845, and piggy-backs on the companion Prisma PR prisma/prisma#23198.

@jkomyno jkomyno self-assigned this Feb 15, 2024
@jkomyno jkomyno added this to the 5.10.0 milestone Feb 15, 2024
Copy link
Contributor

github-actions bot commented Feb 15, 2024

WASM Size

Engine This PR Base branch Diff
Postgres 2.073MiB 2.073MiB 0.000B
Postgres (gzip) 817.713KiB 817.713KiB 0.000B
Mysql 2.055MiB 2.055MiB 0.000B
Mysql (gzip) 809.761KiB 809.759KiB 2.000B
Sqlite 2.016MiB 2.016MiB 0.000B
Sqlite (gzip) 796.695KiB 796.694KiB 1.000B

Copy link

codspeed-hq bot commented Feb 15, 2024

CodSpeed Performance Report

Merging #4738 will not alter performance

Comparing feat/uncomment-da-tests-2 (f584020) with main (09cb2c4)

Summary

✅ 11 untouched benchmarks

Copy link
Contributor

github-actions bot commented Feb 15, 2024

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

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     297 ms/iter       (295 ms … 298 ms)    298 ms    298 ms    298 ms
Web Assembly: Latest       377 ms/iter       (376 ms … 381 ms)    378 ms    381 ms    381 ms
Web Assembly: Current      378 ms/iter       (376 ms … 380 ms)    379 ms    380 ms    380 ms
Node API: Current          196 ms/iter       (195 ms … 198 ms)    197 ms    198 ms    198 ms

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

• movies.findMany({ take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  12'044 µs/iter (11'895 µs … 12'458 µs) 12'078 µs 12'458 µs 12'458 µs
Web Assembly: Latest    15'550 µs/iter (15'099 µs … 17'784 µs) 15'640 µs 17'784 µs 17'784 µs
Web Assembly: Current   15'368 µs/iter (15'116 µs … 16'815 µs) 15'329 µs 16'815 µs 16'815 µs
Node API: Current        8'068 µs/iter   (7'861 µs … 9'485 µs)  8'116 µs  9'485 µs  9'485 µs

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

• movies.findMany({ where: {...}, take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1'984 µs/iter   (1'799 µs … 3'691 µs)  1'911 µs  3'380 µs  3'691 µs
Web Assembly: Latest     2'435 µs/iter   (2'326 µs … 3'244 µs)  2'460 µs  2'977 µs  3'244 µs
Web Assembly: Current    2'444 µs/iter   (2'342 µs … 3'673 µs)  2'421 µs  3'105 µs  3'673 µs
Node API: Current        1'426 µs/iter   (1'344 µs … 1'939 µs)  1'424 µs  1'791 µs  1'939 µs

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

• movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     555 ms/iter       (548 ms … 576 ms)    564 ms    576 ms    576 ms
Web Assembly: Latest       731 ms/iter       (725 ms … 752 ms)    732 ms    752 ms    752 ms
Web Assembly: Current      730 ms/iter       (729 ms … 738 ms)    731 ms    738 ms    738 ms
Node API: Current          462 ms/iter       (454 ms … 475 ms)    467 ms    475 ms    475 ms

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

• movies.findMany({ where: {...}, include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  77'111 µs/iter (76'439 µs … 78'595 µs) 78'421 µs 78'595 µs 78'595 µs
Web Assembly: Latest       102 ms/iter       (102 ms … 103 ms)    103 ms    103 ms    103 ms
Web Assembly: Current      103 ms/iter       (103 ms … 104 ms)    104 ms    104 ms    104 ms
Node API: Current       60'779 µs/iter (59'866 µs … 62'152 µs) 61'546 µs 62'152 µs 62'152 µs

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

• movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     979 ms/iter       (977 ms … 983 ms)    982 ms    983 ms    983 ms
Web Assembly: Latest     1'214 ms/iter   (1'205 ms … 1'234 ms)  1'227 ms  1'234 ms  1'234 ms
Web Assembly: Current    1'219 ms/iter   (1'209 ms … 1'235 ms)  1'232 ms  1'235 ms  1'235 ms
Node API: Current          877 ms/iter       (859 ms … 889 ms)    886 ms    889 ms    889 ms

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

• movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     139 ms/iter       (139 ms … 140 ms)    140 ms    140 ms    140 ms
Web Assembly: Latest       172 ms/iter       (171 ms … 173 ms)    173 ms    173 ms    173 ms
Web Assembly: Current      175 ms/iter       (174 ms … 176 ms)    176 ms    176 ms    176 ms
Node API: Current          111 ms/iter       (109 ms … 114 ms)    112 ms    114 ms    114 ms

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

• movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     895 µs/iter     (826 µs … 1'479 µs)    891 µs  1'361 µs  1'479 µs
Web Assembly: Latest     1'203 µs/iter   (1'132 µs … 1'742 µs)  1'202 µs  1'668 µs  1'742 µs
Web Assembly: Current    1'212 µs/iter   (1'138 µs … 1'920 µs)  1'219 µs  1'725 µs  1'920 µs
Node API: Current          804 µs/iter     (760 µs … 1'296 µs)    814 µs    883 µs  1'296 µs

summary for movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
  Web Assembly: Current
   1.51x slower than Node API: Current
   1.35x 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     876 µs/iter     (823 µs … 1'514 µs)    878 µs  1'278 µs  1'514 µs
Web Assembly: Latest     1'202 µs/iter   (1'134 µs … 1'830 µs)  1'201 µs  1'685 µs  1'830 µs
Web Assembly: Current    1'211 µs/iter   (1'144 µs … 1'875 µs)  1'209 µs  1'719 µs  1'875 µs
Node API: Current          817 µs/iter     (728 µs … 1'496 µs)    825 µs  1'169 µs  1'496 µs

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

After changes in f584020

@jkomyno
Copy link
Contributor Author

jkomyno commented Feb 26, 2024

(Pushed some a new commit after the approval, it's just new comments + test uncomments. Let's see how the CI goes)

@jkomyno jkomyno marked this pull request as ready for review February 26, 2024 14:51
@jkomyno jkomyno requested a review from a team as a code owner February 26, 2024 14:51
@jkomyno jkomyno requested review from laplab and removed request for a team and laplab February 26, 2024 14:51
jkomyno and others added 3 commits February 28, 2024 13:03
…p_level_mutations::update_many::update_many test via DRIVER_ADAPTERS_BRANCH=fix/planetscale-parse-error-message-2
@jkomyno
Copy link
Contributor Author

jkomyno commented Feb 28, 2024

prisma/prisma#23198 is merged. I'm now merging this companion engines' PR. The only remaining CI tests are Cockroach-related, and hence their termination is not relevant for the scope of this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants