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

Fix datasource URL override for c-abi engine #4863

Merged
merged 1 commit into from May 10, 2024
Merged

Fix datasource URL override for c-abi engine #4863

merged 1 commit into from May 10, 2024

Conversation

SevInf
Copy link
Contributor

@SevInf SevInf commented May 10, 2024

url for applyPendingMigrations was saved before we applied overrides from the constructor.
So, in this case, client used correct url from the constructor, but migrations were applied to the one specified in the schema.
Also, replaces panic on unset env var with a proper error.

Close #1139

@SevInf SevInf added this to the 5.14.0 milestone May 10, 2024
Copy link

codspeed-hq bot commented May 10, 2024

CodSpeed Performance Report

Merging #4863 will not alter performance

Comparing fix/ds-url-rn (03c57ba) with main (e162a52)

Summary

✅ 11 untouched benchmarks

Copy link
Contributor

github-actions bot commented May 10, 2024

WASM Query Engine file Size

Engine This PR Base branch Diff
Postgres 2.152MiB 2.152MiB 0.000B
Postgres (gzip) 845.854KiB 845.856KiB -2.000B
Mysql 2.123MiB 2.123MiB 0.000B
Mysql (gzip) 832.880KiB 832.881KiB -1.000B
Sqlite 2.016MiB 2.016MiB 0.000B
Sqlite (gzip) 793.209KiB 793.209KiB 0.000B

Copy link
Contributor

github-actions bot commented May 10, 2024

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

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       (367 ms … 375 ms)    373 ms    375 ms    375 ms
Web Assembly: Latest       457 ms/iter       (454 ms … 464 ms)    458 ms    464 ms    464 ms
Web Assembly: Current      456 ms/iter       (452 ms … 461 ms)    460 ms    461 ms    461 ms
Node API: Current          197 ms/iter       (195 ms … 200 ms)    198 ms    200 ms    200 ms

summary for movies.findMany() (all - ~50K)
  Web Assembly: Current
   2.31x 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  14'901 µs/iter (14'747 µs … 15'336 µs) 14'928 µs 15'336 µs 15'336 µs
Web Assembly: Latest    18'509 µs/iter (18'217 µs … 20'466 µs) 18'478 µs 20'466 µs 20'466 µs
Web Assembly: Current   18'469 µs/iter (18'184 µs … 19'280 µs) 18'497 µs 19'280 µs 19'280 µs
Node API: Current        8'218 µs/iter  (7'918 µs … 10'169 µs)  8'144 µs 10'169 µs 10'169 µs

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

• movies.findMany({ where: {...}, take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   2'291 µs/iter   (2'202 µs … 3'373 µs)  2'289 µs  2'674 µs  3'373 µs
Web Assembly: Latest     2'877 µs/iter   (2'767 µs … 4'749 µs)  2'841 µs  3'871 µs  4'749 µs
Web Assembly: Current    2'879 µs/iter   (2'771 µs … 3'675 µs)  2'859 µs  3'575 µs  3'675 µs
Node API: Current        1'411 µs/iter   (1'311 µs … 1'855 µs)  1'424 µs  1'688 µs  1'855 µs

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

• movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     570 ms/iter       (565 ms … 586 ms)    571 ms    586 ms    586 ms
Web Assembly: Latest       776 ms/iter       (772 ms … 783 ms)    781 ms    783 ms    783 ms
Web Assembly: Current      792 ms/iter       (783 ms … 814 ms)    808 ms    814 ms    814 ms
Node API: Current          480 ms/iter       (473 ms … 491 ms)    487 ms    491 ms    491 ms

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

• movies.findMany({ where: {...}, include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  79'289 µs/iter (79'055 µs … 79'740 µs) 79'377 µs 79'740 µs 79'740 µs
Web Assembly: Latest       110 ms/iter       (110 ms … 111 ms)    111 ms    111 ms    111 ms
Web Assembly: Current      113 ms/iter       (112 ms … 114 ms)    113 ms    114 ms    114 ms
Node API: Current       63'467 µs/iter (62'389 µs … 64'547 µs) 64'434 µs 64'547 µs 64'547 µs

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

• movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1'013 ms/iter   (1'005 ms … 1'026 ms)  1'020 ms  1'026 ms  1'026 ms
Web Assembly: Latest     1'302 ms/iter   (1'291 ms … 1'318 ms)  1'318 ms  1'318 ms  1'318 ms
Web Assembly: Current    1'315 ms/iter   (1'303 ms … 1'341 ms)  1'333 ms  1'341 ms  1'341 ms
Node API: Current          876 ms/iter       (860 ms … 896 ms)    889 ms    896 ms    896 ms

summary for movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
  Web Assembly: Current
   1.5x slower than Node API: Current
   1.3x 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     145 ms/iter       (143 ms … 150 ms)    145 ms    150 ms    150 ms
Web Assembly: Latest       185 ms/iter       (183 ms … 188 ms)    187 ms    188 ms    188 ms
Web Assembly: Current      185 ms/iter       (183 ms … 187 ms)    186 ms    187 ms    187 ms
Node API: Current          109 ms/iter       (107 ms … 115 ms)    111 ms    115 ms    115 ms

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

• movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1'037 µs/iter     (979 µs … 1'787 µs)  1'030 µs  1'661 µs  1'787 µs
Web Assembly: Latest     1'394 µs/iter   (1'324 µs … 2'151 µs)  1'384 µs  1'945 µs  2'151 µs
Web Assembly: Current    1'393 µs/iter   (1'333 µs … 1'992 µs)  1'388 µs  1'900 µs  1'992 µs
Node API: Current          759 µs/iter     (704 µs … 1'169 µs)    796 µs    845 µs  1'169 µs

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

• movie.findMany({ where: { cast: { person: { ... } }, take: 100 }) (m2m -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1'056 µs/iter   (1'010 µs … 1'724 µs)  1'055 µs  1'702 µs  1'724 µs
Web Assembly: Latest     1'373 µs/iter   (1'304 µs … 2'183 µs)  1'368 µs  2'075 µs  2'183 µs
Web Assembly: Current    1'403 µs/iter   (1'311 µs … 2'548 µs)  1'384 µs  2'459 µs  2'548 µs
Node API: Current          779 µs/iter     (704 µs … 1'163 µs)    805 µs    991 µs  1'163 µs

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

After changes in 03c57ba

@SevInf SevInf marked this pull request as ready for review May 10, 2024 12:50
@SevInf SevInf requested a review from a team as a code owner May 10, 2024 12:50
@SevInf SevInf requested review from Weakky and removed request for a team May 10, 2024 12:50
@SevInf SevInf changed the title [WIP]: Fix datasource URL override for c-abi engine Fix datasource URL override for c-abi engine May 10, 2024
@SevInf SevInf merged commit a8ad08f into main May 10, 2024
186 checks passed
@SevInf SevInf deleted the fix/ds-url-rn branch May 10, 2024 13:13
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