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: add multi-file introspection to schema engine cli #4882

Closed
wants to merge 8 commits into from

Conversation

Weakky
Copy link
Member

@Weakky Weakky commented May 23, 2024

Closed in favor of #4892

Copy link

codspeed-hq bot commented May 23, 2024

CodSpeed Performance Report

Merging #4882 will not alter performance

Comparing feat/multi-file-introspection-cli-1 (27cfda7) with main (bca2d36)

Summary

✅ 11 untouched benchmarks

Copy link
Contributor

github-actions bot commented May 23, 2024

WASM Query Engine file Size

Engine This PR Base branch Diff
Postgres 2.041MiB 2.041MiB 0.000B
Postgres (gzip) 813.273KiB 813.273KiB 0.000B
Mysql 2.011MiB 2.011MiB 0.000B
Mysql (gzip) 799.905KiB 799.904KiB 1.000B
Sqlite 1.914MiB 1.914MiB 0.000B
Sqlite (gzip) 762.656KiB 762.655KiB 1.000B

Copy link
Contributor

github-actions bot commented May 23, 2024

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

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

benchmark                   time (avg)             (min … max)       p75       p99      p999
-------------------------------------------------------------- -----------------------------
• movies.findMany() (all - ~50K)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     369 ms/iter       (366 ms … 374 ms)    373 ms    374 ms    374 ms
Web Assembly: Latest       467 ms/iter       (463 ms … 473 ms)    471 ms    473 ms    473 ms
Web Assembly: Current      466 ms/iter       (461 ms … 471 ms)    469 ms    471 ms    471 ms
Node API: Current          203 ms/iter       (198 ms … 213 ms)    208 ms    213 ms    213 ms

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

• movies.findMany({ take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  14'897 µs/iter (14'500 µs … 17'135 µs) 14'927 µs 17'135 µs 17'135 µs
Web Assembly: Latest    18'714 µs/iter (18'362 µs … 21'152 µs) 18'856 µs 21'152 µs 21'152 µs
Web Assembly: Current   18'910 µs/iter (18'696 µs … 19'102 µs) 18'991 µs 19'102 µs 19'102 µs
Node API: Current        8'398 µs/iter  (7'939 µs … 12'067 µs)  8'397 µs 12'067 µs 12'067 µs

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

• movies.findMany({ where: {...}, take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   2'302 µs/iter   (2'195 µs … 3'392 µs)  2'283 µs  3'133 µs  3'392 µs
Web Assembly: Latest     2'937 µs/iter   (2'828 µs … 4'524 µs)  2'920 µs  3'624 µs  4'524 µs
Web Assembly: Current    2'941 µs/iter   (2'814 µs … 4'702 µs)  2'906 µs  3'820 µs  4'702 µs
Node API: Current        1'415 µs/iter   (1'308 µs … 1'775 µs)  1'420 µs  1'739 µs  1'775 µs

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

• movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     578 ms/iter       (570 ms … 596 ms)    583 ms    596 ms    596 ms
Web Assembly: Latest       781 ms/iter       (775 ms … 796 ms)    787 ms    796 ms    796 ms
Web Assembly: Current      785 ms/iter       (779 ms … 808 ms)    784 ms    808 ms    808 ms
Node API: Current          476 ms/iter       (468 ms … 484 ms)    482 ms    484 ms    484 ms

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

• movies.findMany({ where: {...}, include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  80'045 µs/iter (79'441 µs … 82'035 µs) 80'409 µs 82'035 µs 82'035 µs
Web Assembly: Latest       110 ms/iter       (110 ms … 112 ms)    111 ms    112 ms    112 ms
Web Assembly: Current      111 ms/iter       (110 ms … 112 ms)    112 ms    112 ms    112 ms
Node API: Current       62'567 µs/iter (61'745 µs … 63'576 µs) 63'303 µs 63'576 µs 63'576 µs

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

• movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1'014 ms/iter   (1'005 ms … 1'033 ms)  1'031 ms  1'033 ms  1'033 ms
Web Assembly: Latest     1'285 ms/iter   (1'277 ms … 1'302 ms)  1'289 ms  1'302 ms  1'302 ms
Web Assembly: Current    1'301 ms/iter   (1'287 ms … 1'320 ms)  1'316 ms  1'320 ms  1'320 ms
Node API: Current          871 ms/iter       (860 ms … 892 ms)    874 ms    892 ms    892 ms

summary for movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
  Web Assembly: Current
   1.49x slower than Node API: Current
   1.28x 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       (144 ms … 150 ms)    146 ms    150 ms    150 ms
Web Assembly: Latest       183 ms/iter       (182 ms … 187 ms)    184 ms    187 ms    187 ms
Web Assembly: Current      184 ms/iter       (183 ms … 186 ms)    185 ms    186 ms    186 ms
Node API: Current          114 ms/iter       (110 ms … 116 ms)    115 ms    116 ms    116 ms

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

• movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1'036 µs/iter     (979 µs … 1'785 µs)  1'030 µs  1'562 µs  1'785 µs
Web Assembly: Latest     1'409 µs/iter   (1'330 µs … 2'264 µs)  1'408 µs  1'888 µs  2'264 µs
Web Assembly: Current    1'405 µs/iter   (1'325 µs … 2'249 µs)  1'399 µs  2'214 µs  2'249 µs
Node API: Current          763 µs/iter     (702 µs … 1'208 µs)    792 µs    826 µs  1'208 µs

summary for movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
  Web Assembly: Current
   1.84x slower than Node API: Current
   1.36x 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'038 µs/iter     (981 µs … 1'731 µs)  1'037 µs  1'511 µs  1'731 µs
Web Assembly: Latest     1'419 µs/iter   (1'334 µs … 2'356 µs)  1'405 µs  2'191 µs  2'356 µs
Web Assembly: Current    1'407 µs/iter   (1'337 µs … 2'257 µs)  1'403 µs  2'121 µs  2'257 µs
Node API: Current          797 µs/iter     (752 µs … 1'137 µs)    809 µs    849 µs  1'137 µs

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

After changes in 27cfda7

@Weakky Weakky added this to the 5.15.0 milestone May 23, 2024
@Weakky Weakky marked this pull request as ready for review May 27, 2024 15:39
@Weakky Weakky requested a review from a team as a code owner May 27, 2024 15:39
@Weakky Weakky requested review from laplab and removed request for a team May 27, 2024 15:39
@SevInf SevInf self-requested a review May 27, 2024 15:44
Copy link
Contributor

@SevInf SevInf left a comment

Choose a reason for hiding this comment

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

Nit on the naming and one more thing: can we have a little bit more tests for re-introspection of existing models and new models being added?

schema-engine/cli/tests/cli_tests.rs Outdated Show resolved Hide resolved
Base automatically changed from feat/multi-file-migrate to main May 28, 2024 10:38
Copy link
Contributor

@SevInf SevInf left a comment

Choose a reason for hiding this comment

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

LGTM after integration PR for client lined up

@Weakky Weakky closed this May 30, 2024
@Weakky
Copy link
Member Author

Weakky commented May 30, 2024

Follow-up PR: #4892

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