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(fmt): QF - native type for mongodb @default(auto) #4629

Merged
merged 2 commits into from
Jan 8, 2024

Conversation

Druue
Copy link
Contributor

@Druue Druue commented Jan 4, 2024

Screen.Recording.2024-01-04.at.21.44.25.mov

closes prisma/language-tools#1548

- quickfix for mongodb native type with `@default(auto)`

closes prisma/language-tools#1548
@Druue Druue added this to the 5.8.0 milestone Jan 4, 2024
@Druue Druue requested a review from a team as a code owner January 4, 2024 20:41
@Druue Druue requested review from laplab and Weakky and removed request for a team January 4, 2024 20:41
Copy link
Contributor

github-actions bot commented Jan 4, 2024

WASM Size

Engine This PR Base branch Diff
WASM 2.744MiB 2.744MiB 0.000B
WASM (gzip) 1.006MiB 1.006MiB 0.000B

Copy link

codspeed-hq bot commented Jan 4, 2024

CodSpeed Performance Report

Merging #4629 will not alter performance

Comparing feat/qf-mdb-auto-native (3a1bd50) with main (babfd59)

Summary

✅ 11 untouched benchmarks

Copy link
Contributor

github-actions bot commented Jan 4, 2024

✅ WASM query-engine: no benchmarks have regressed

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  302.87 ms/iter (300.21 ms … 311.51 ms) 302.74 ms 311.51 ms 311.51 ms
Web Assembly: Latest    305.04 ms/iter (301.15 ms … 316.37 ms) 305.86 ms 316.37 ms 316.37 ms
Web Assembly: Current    304.1 ms/iter (302.32 ms … 311.72 ms) 303.95 ms 311.72 ms 311.72 ms
Node API: Current       233.72 ms/iter  (229.66 ms … 247.8 ms) 235.31 ms  247.8 ms  247.8 ms

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

• movies.findMany({ take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   12.51 ms/iter   (11.85 ms … 17.06 ms)  12.46 ms  17.06 ms  17.06 ms
Web Assembly: Latest     12.61 ms/iter   (12.13 ms … 17.59 ms)   12.5 ms  17.59 ms  17.59 ms
Web Assembly: Current    12.54 ms/iter   (11.91 ms … 16.88 ms)  12.34 ms  16.88 ms  16.88 ms
Node API: Current         9.33 ms/iter    (9.05 ms … 11.42 ms)   9.33 ms  11.42 ms  11.42 ms

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

• movies.findMany({ where: {...}, take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline    2.04 ms/iter     (1.85 ms … 3.59 ms)   1.96 ms   3.45 ms   3.45 ms
Web Assembly: Latest      2.04 ms/iter     (1.83 ms … 3.51 ms)   1.98 ms   3.39 ms    3.4 ms
Web Assembly: Current     1.98 ms/iter     (1.83 ms … 3.39 ms)   1.94 ms   3.33 ms   3.35 ms
Node API: Current         1.52 ms/iter     (1.46 ms … 1.73 ms)   1.52 ms   1.71 ms   1.72 ms

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

• movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   12.14 ms/iter    (11.8 ms … 12.67 ms)  12.21 ms  12.67 ms  12.67 ms
Web Assembly: Latest      12.2 ms/iter      (12.07 ms … 13 ms)  12.21 ms     13 ms     13 ms
Web Assembly: Current    12.16 ms/iter   (11.85 ms … 12.76 ms)  12.25 ms  12.76 ms  12.76 ms
Node API: Current         9.56 ms/iter    (9.25 ms … 14.49 ms)   9.61 ms  14.49 ms  14.49 ms

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

• movies.findMany({ where: {...}, include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline    1.94 ms/iter     (1.83 ms … 3.17 ms)   1.91 ms   2.85 ms   2.87 ms
Web Assembly: Latest      1.92 ms/iter     (1.81 ms … 3.14 ms)    1.9 ms      3 ms   3.01 ms
Web Assembly: Current     1.87 ms/iter     (1.81 ms … 2.28 ms)   1.87 ms   2.17 ms   2.26 ms
Node API: Current         1.54 ms/iter     (1.48 ms … 1.73 ms)   1.55 ms   1.73 ms   1.73 ms

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

• movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   12.39 ms/iter   (11.82 ms … 20.94 ms)  12.23 ms  20.94 ms  20.94 ms
Web Assembly: Latest      12.3 ms/iter   (12.12 ms … 16.32 ms)  12.24 ms  16.32 ms  16.32 ms
Web Assembly: Current    12.16 ms/iter   (11.85 ms … 13.89 ms)  12.21 ms  13.89 ms  13.89 ms
Node API: Current         9.41 ms/iter    (9.01 ms … 10.64 ms)   9.49 ms  10.64 ms  10.64 ms

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

• movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline    1.91 ms/iter     (1.81 ms … 3.09 ms)    1.9 ms   2.83 ms   2.95 ms
Web Assembly: Latest       1.9 ms/iter     (1.81 ms … 2.99 ms)    1.9 ms   2.81 ms   2.81 ms
Web Assembly: Current     1.89 ms/iter     (1.82 ms … 2.46 ms)   1.88 ms   2.35 ms   2.43 ms
Node API: Current         1.59 ms/iter     (1.52 ms … 2.11 ms)    1.6 ms   1.81 ms   2.07 ms

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

• movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  935.87 µs/iter   (864.04 µs … 1.84 ms) 923.93 µs   1.52 ms   1.58 ms
Web Assembly: Latest    917.44 µs/iter   (871.84 µs … 1.51 ms) 916.85 µs   1.43 ms   1.46 ms
Web Assembly: Current   917.75 µs/iter   (877.74 µs … 1.42 ms) 919.68 µs   1.19 ms   1.24 ms
Node API: Current       851.28 µs/iter   (774.96 µs … 1.12 ms) 865.26 µs   1.01 ms   1.03 ms

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

• movie.findMany({ where: { cast: { person: { ... } }, take: 100 }) (m2m -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  909.56 µs/iter   (861.36 µs … 1.46 ms) 910.56 µs   1.29 ms   1.41 ms
Web Assembly: Latest    897.02 µs/iter   (853.45 µs … 1.45 ms) 896.61 µs   1.32 ms   1.34 ms
Web Assembly: Current   902.68 µs/iter   (861.81 µs … 1.53 ms) 900.09 µs   1.34 ms   1.47 ms
Node API: Current       845.25 µs/iter    (769.11 µs … 1.1 ms) 863.97 µs 976.72 µs   1.02 ms

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

After changes in 3a1bd50

- Actually use datasource name rather than "db"
Copy link
Member

@Jolg42 Jolg42 left a comment

Choose a reason for hiding this comment

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

Nice one! ✨

@Druue Druue merged commit 98ee706 into main Jan 8, 2024
138 checks passed
@Druue Druue deleted the feat/qf-mdb-auto-native branch January 8, 2024 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants