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(qe): enable queries with returning for sqlite #4640

Merged
merged 3 commits into from
Jan 17, 2024

Conversation

laplab
Copy link
Contributor

@laplab laplab commented Jan 11, 2024

No description provided.

@laplab laplab added this to the 5.9.0 milestone Jan 11, 2024
@laplab laplab self-assigned this Jan 11, 2024
@laplab laplab requested a review from a team as a code owner January 11, 2024 16:02
@laplab laplab requested review from Weakky and Druue and removed request for a team January 11, 2024 16:02
Copy link
Contributor

github-actions bot commented Jan 11, 2024

WASM Size

Engine This PR Base branch Diff
WASM 2.338MiB 2.338MiB -442.000B
WASM (gzip) 907.726KiB 907.589KiB 140.000B

Copy link

codspeed-hq bot commented Jan 11, 2024

CodSpeed Performance Report

Merging #4640 will not alter performance

Comparing feat/enable-queries-with-returning-for-sqlite (187de50) with main (7f4fc14)

Summary

✅ 11 untouched benchmarks

Copy link
Contributor

github-actions bot commented Jan 11, 2024

🚨 WASM query-engine: 9 benchmark(s) have regressed at least 2%

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

benchmark                   time (avg)             (min … max)       p75       p99      p995
-------------------------------------------------------------- -----------------------------
• movies.findMany() (all - 25000)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  304.65 ms/iter (300.48 ms … 319.77 ms) 304.14 ms 319.77 ms 319.77 ms
Web Assembly: Latest    311.68 ms/iter  (307.4 ms … 319.35 ms) 314.33 ms 319.35 ms 319.35 ms
Web Assembly: Current   394.63 ms/iter (389.77 ms … 401.89 ms) 395.68 ms 401.89 ms 401.89 ms
Node API: Current       232.99 ms/iter (221.41 ms … 252.17 ms) 235.64 ms 252.17 ms 252.17 ms

summary for movies.findMany() (all - 25000)
  Web Assembly: Current
   1.69x slower than Node API: Current
   1.3x slower than Web Assembly: Baseline
   1.27x slower than Web Assembly: Latest

• movies.findMany({ take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   12.36 ms/iter   (11.81 ms … 15.74 ms)  12.17 ms  15.74 ms  15.74 ms
Web Assembly: Latest     12.61 ms/iter   (12.08 ms … 18.13 ms)  12.47 ms  18.13 ms  18.13 ms
Web Assembly: Current    16.15 ms/iter   (15.66 ms … 24.03 ms)  15.86 ms  24.03 ms  24.03 ms
Node API: Current         9.31 ms/iter     (8.77 ms … 9.84 ms)   9.46 ms   9.84 ms   9.84 ms

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

• movies.findMany({ where: {...}, take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline       2 ms/iter     (1.83 ms … 3.38 ms)   1.96 ms   3.35 ms   3.37 ms
Web Assembly: Latest      2.12 ms/iter     (1.87 ms … 3.45 ms)   2.11 ms   3.39 ms   3.43 ms
Web Assembly: Current     2.66 ms/iter      (2.41 ms … 4.3 ms)    2.6 ms   4.28 ms    4.3 ms
Node API: Current         1.54 ms/iter     (1.43 ms … 1.96 ms)   1.55 ms   1.77 ms   1.95 ms

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

• movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline    12.1 ms/iter    (11.8 ms … 12.67 ms)  12.17 ms  12.67 ms  12.67 ms
Web Assembly: Latest     12.41 ms/iter   (12.28 ms … 12.72 ms)  12.42 ms  12.72 ms  12.72 ms
Web Assembly: Current    15.85 ms/iter   (15.34 ms … 20.05 ms)  15.77 ms  20.05 ms  20.05 ms
Node API: Current         9.21 ms/iter     (9.04 ms … 9.63 ms)   9.25 ms   9.63 ms   9.63 ms

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

• movies.findMany({ where: {...}, include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline    1.97 ms/iter      (1.83 ms … 3.4 ms)   1.92 ms    3.1 ms   3.22 ms
Web Assembly: Latest      1.99 ms/iter     (1.87 ms … 5.04 ms)   1.95 ms   3.12 ms   3.33 ms
Web Assembly: Current      2.5 ms/iter     (2.41 ms … 3.17 ms)   2.51 ms   2.95 ms    3.1 ms
Node API: Current         1.55 ms/iter     (1.45 ms … 2.12 ms)   1.56 ms   1.82 ms      2 ms

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

• movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   12.15 ms/iter     (11.8 ms … 12.7 ms)   12.2 ms   12.7 ms   12.7 ms
Web Assembly: Latest     12.53 ms/iter   (12.28 ms … 17.55 ms)  12.44 ms  17.55 ms  17.55 ms
Web Assembly: Current    15.65 ms/iter   (15.34 ms … 16.65 ms)  15.69 ms  16.65 ms  16.65 ms
Node API: Current         9.47 ms/iter    (9.09 ms … 11.98 ms)   9.35 ms  11.98 ms  11.98 ms

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

• movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     1.9 ms/iter     (1.81 ms … 2.91 ms)   1.89 ms   2.81 ms   2.82 ms
Web Assembly: Latest      1.91 ms/iter     (1.85 ms … 2.45 ms)   1.91 ms   2.42 ms   2.44 ms
Web Assembly: Current     2.49 ms/iter     (2.39 ms … 3.22 ms)   2.48 ms   3.07 ms   3.11 ms
Node API: Current         1.58 ms/iter     (1.47 ms … 1.77 ms)   1.59 ms   1.75 ms   1.76 ms

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

• movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  934.06 µs/iter   (873.14 µs … 1.78 ms) 931.15 µs   1.44 ms   1.47 ms
Web Assembly: Latest    945.27 µs/iter   (864.86 µs … 1.54 ms) 929.29 µs   1.44 ms   1.49 ms
Web Assembly: Current     1.24 ms/iter     (1.15 ms … 2.24 ms)   1.24 ms   1.96 ms   2.04 ms
Node API: Current       825.33 µs/iter   (769.18 µs … 1.09 ms) 855.69 µs 982.95 µs 992.65 µ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.33x slower than Web Assembly: Baseline
   1.32x slower than Web Assembly: Latest

• movie.findMany({ where: { cast: { person: { ... } }, take: 100 }) (m2m -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  902.99 µs/iter    (851.09 µs … 1.6 ms) 900.06 µs   1.42 ms   1.47 ms
Web Assembly: Latest     982.8 µs/iter   (879.28 µs … 1.75 ms)  948.3 µs    1.7 ms   1.72 ms
Web Assembly: Current     1.22 ms/iter     (1.16 ms … 1.86 ms)   1.23 ms    1.6 ms   1.73 ms
Node API: Current       851.83 µs/iter   (758.71 µs … 1.13 ms) 867.15 µs 994.78 µs   1.03 ms

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

After changes in 187de50

Copy link
Contributor

@Weakky Weakky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good from my side but let's wait for tests to go green before merging 🙏

@laplab laplab force-pushed the feat/enable-queries-with-returning-for-sqlite branch from 880c3b9 to 187de50 Compare January 17, 2024 15:50
@laplab laplab requested a review from Weakky January 17, 2024 16:29
@laplab laplab merged commit ffecfca into main Jan 17, 2024
139 of 140 checks passed
@laplab laplab deleted the feat/enable-queries-with-returning-for-sqlite branch January 17, 2024 16:33
Copy link
Contributor

@Weakky Weakky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great news, LGTM 👍

jkomyno added a commit to prisma/prisma that referenced this pull request Jan 18, 2024
* fix(migrate): update tests after fix to #11407

* chore(deps): update engines to 5.9.0-14.9c3f205e267265347308a10c5883579abb8361e1

* feat(client): update logging tests for sqlite after prisma/prisma-engines#4640

* feat(client): update tracing tests for sqlite after prisma/prisma-engines#4640

---------

Co-authored-by: Prismo <[email protected]>
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