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(introspection-warnings): Change wording #4834

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

janpio
Copy link
Member

@janpio janpio commented Apr 23, 2024

fix weird wording detected in prisma/prisma@eba8ef3 (#18869)

replaces #3917

@janpio janpio marked this pull request as ready for review April 23, 2024 14:03
@janpio janpio requested a review from a team as a code owner April 23, 2024 14:03
@janpio janpio requested review from jkomyno and removed request for a team April 23, 2024 14:03
Copy link
Contributor

WASM Query Engine file Size

Engine This PR Base branch Diff
Postgres 2.130MiB 2.130MiB 0.000B
Postgres (gzip) 838.789KiB 838.788KiB 1.000B
Mysql 2.098MiB 2.098MiB 0.000B
Mysql (gzip) 825.534KiB 825.533KiB 1.000B
Sqlite 1.991MiB 1.991MiB 0.000B
Sqlite (gzip) 785.919KiB 785.917KiB 3.000B

Copy link

codspeed-hq bot commented Apr 23, 2024

CodSpeed Performance Report

Merging #4834 will not alter performance

Comparing janpio/introspection-warning-rewording (e1d14e5) with main (e5f3dd7)

Summary

✅ 11 untouched benchmarks

Copy link
Contributor

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

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     373 ms/iter       (370 ms … 378 ms)    377 ms    378 ms    378 ms
Web Assembly: Latest       459 ms/iter       (458 ms … 463 ms)    462 ms    463 ms    463 ms
Web Assembly: Current      456 ms/iter       (452 ms … 465 ms)    458 ms    465 ms    465 ms
Node API: Current          199 ms/iter       (197 ms … 201 ms)    201 ms    201 ms    201 ms

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

• movies.findMany({ take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  15'209 µs/iter (14'914 µs … 18'038 µs) 15'162 µs 18'038 µs 18'038 µs
Web Assembly: Latest    18'756 µs/iter (18'470 µs … 19'571 µs) 18'790 µs 19'571 µs 19'571 µs
Web Assembly: Current   18'612 µs/iter (18'259 µs … 20'292 µs) 18'619 µs 20'292 µs 20'292 µs
Node API: Current        8'248 µs/iter   (8'042 µs … 8'592 µs)  8'319 µs  8'592 µs  8'592 µs

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

• movies.findMany({ where: {...}, take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   2'338 µs/iter   (2'184 µs … 3'859 µs)  2'294 µs  3'425 µs  3'859 µs
Web Assembly: Latest     2'854 µs/iter   (2'764 µs … 3'953 µs)  2'846 µs  3'267 µs  3'953 µs
Web Assembly: Current    2'886 µs/iter   (2'745 µs … 4'700 µs)  2'853 µs  3'736 µs  4'700 µs
Node API: Current        1'407 µs/iter   (1'304 µs … 1'840 µs)  1'412 µs  1'728 µs  1'840 µs

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

• movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     575 ms/iter       (567 ms … 593 ms)    587 ms    593 ms    593 ms
Web Assembly: Latest       777 ms/iter       (768 ms … 795 ms)    791 ms    795 ms    795 ms
Web Assembly: Current      773 ms/iter       (768 ms … 784 ms)    774 ms    784 ms    784 ms
Node API: Current          480 ms/iter       (464 ms … 494 ms)    490 ms    494 ms    494 ms

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

• movies.findMany({ where: {...}, include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  79'434 µs/iter (78'971 µs … 80'208 µs) 79'799 µs 80'208 µs 80'208 µs
Web Assembly: Latest       109 ms/iter       (108 ms … 109 ms)    109 ms    109 ms    109 ms
Web Assembly: Current      108 ms/iter       (108 ms … 109 ms)    109 ms    109 ms    109 ms
Node API: Current       60'235 µs/iter (59'946 µs … 60'472 µs) 60'453 µs 60'472 µs 60'472 µs

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

• movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1'000 ms/iter     (991 ms … 1'027 ms)  1'001 ms  1'027 ms  1'027 ms
Web Assembly: Latest     1'291 ms/iter   (1'281 ms … 1'306 ms)  1'297 ms  1'306 ms  1'306 ms
Web Assembly: Current    1'288 ms/iter   (1'274 ms … 1'306 ms)  1'304 ms  1'306 ms  1'306 ms
Node API: Current          864 ms/iter       (846 ms … 880 ms)    878 ms    880 ms    880 ms

summary for movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
  Web Assembly: Current
   1.49x 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     140 ms/iter       (139 ms … 140 ms)    140 ms    140 ms    140 ms
Web Assembly: Latest       180 ms/iter       (179 ms … 181 ms)    180 ms    181 ms    181 ms
Web Assembly: Current      180 ms/iter       (179 ms … 181 ms)    180 ms    181 ms    181 ms
Node API: Current          104 ms/iter       (102 ms … 105 ms)    105 ms    105 ms    105 ms

summary for movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
  Web Assembly: Current
   1.73x slower than Node API: Current
   1.29x 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'047 µs/iter     (999 µs … 1'728 µs)  1'046 µs  1'412 µs  1'728 µs
Web Assembly: Latest     1'370 µs/iter   (1'295 µs … 2'267 µs)  1'359 µs  1'987 µs  2'267 µs
Web Assembly: Current    1'360 µs/iter   (1'294 µs … 1'897 µs)  1'363 µs  1'734 µs  1'897 µs
Node API: Current          780 µs/iter     (699 µs … 1'571 µs)    797 µs  1'185 µs  1'571 µ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 faster than Web Assembly: Latest

• movie.findMany({ where: { cast: { person: { ... } }, take: 100 }) (m2m -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1'022 µs/iter     (982 µs … 1'449 µs)  1'029 µs  1'361 µs  1'449 µs
Web Assembly: Latest     1'351 µs/iter   (1'299 µs … 1'959 µs)  1'358 µs  1'676 µs  1'959 µs
Web Assembly: Current    1'353 µs/iter   (1'300 µs … 1'748 µs)  1'362 µs  1'664 µs  1'748 µs
Node API: Current          763 µs/iter     (707 µs … 1'006 µs)    792 µs    881 µs  1'006 µs

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

After changes in e1d14e5

Copy link
Contributor

@Druue Druue left a comment

Choose a reason for hiding this comment

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

Unsure about this specific wording, what does this Prisma schema mean? and especially what will it mean once multi-file schema is introduced?

The plan is that everything will be concatenated so we still won't allow for duplicates across schema files.

I don't think we allow for models with duplicate names across multiSchema schemas either

@janpio
Copy link
Member Author

janpio commented Apr 23, 2024

  • "this Prisma schema" refers to the Prisma schema that was validated.
  • Multi-file schema is not an existing feature.
  • The suggested wording is more correct than the clearly incorrect "Prisma Schema Language"

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