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(se): Empty dbgenerated() breaking for Unsupported() types #4841

Merged
merged 2 commits into from Apr 30, 2024
Merged

Conversation

Druue
Copy link
Contributor

@Druue Druue commented Apr 26, 2024

fixes #15654

@Druue Druue requested a review from a team as a code owner April 26, 2024 09:14
@Druue Druue requested review from jkomyno and removed request for a team April 26, 2024 09:14
@Druue Druue marked this pull request as draft April 26, 2024 09:14
Copy link
Contributor

github-actions bot commented Apr 26, 2024

WASM Query Engine file Size

Engine This PR Base branch Diff
Postgres 2.137MiB 2.137MiB 0.000B
Postgres (gzip) 840.812KiB 840.811KiB 1.000B
Mysql 2.107MiB 2.107MiB 0.000B
Mysql (gzip) 827.980KiB 827.978KiB 2.000B
Sqlite 1.998MiB 1.998MiB 0.000B
Sqlite (gzip) 787.576KiB 787.576KiB 0.000B

Copy link

codspeed-hq bot commented Apr 26, 2024

CodSpeed Performance Report

Merging #4841 will not alter performance

Comparing regr/15654 (05e0213) with main (744b41c)

Summary

✅ 11 untouched benchmarks

Copy link
Contributor

github-actions bot commented Apr 26, 2024

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

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     292 ms/iter       (287 ms … 298 ms)    296 ms    298 ms    298 ms
Web Assembly: Latest       379 ms/iter       (378 ms … 382 ms)    381 ms    382 ms    382 ms
Web Assembly: Current      382 ms/iter       (380 ms … 386 ms)    385 ms    386 ms    386 ms
Node API: Current          198 ms/iter       (196 ms … 201 ms)    199 ms    201 ms    201 ms

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

• movies.findMany({ take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  11'850 µs/iter (11'621 µs … 13'826 µs) 11'822 µs 13'826 µs 13'826 µs
Web Assembly: Latest    15'566 µs/iter (15'112 µs … 18'045 µs) 15'395 µs 18'045 µs 18'045 µs
Web Assembly: Current   15'422 µs/iter (15'173 µs … 17'160 µs) 15'412 µs 17'160 µs 17'160 µs
Node API: Current        7'995 µs/iter   (7'780 µs … 8'237 µs)  8'078 µs  8'237 µs  8'237 µs

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

• movies.findMany({ where: {...}, take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1'951 µs/iter   (1'782 µs … 3'422 µs)  1'909 µs  3'362 µs  3'422 µs
Web Assembly: Latest     2'408 µs/iter   (2'321 µs … 3'259 µs)  2'399 µs  2'947 µs  3'259 µs
Web Assembly: Current    2'430 µs/iter   (2'357 µs … 3'066 µs)  2'426 µs  2'699 µs  3'066 µs
Node API: Current        1'384 µs/iter   (1'290 µs … 1'808 µs)  1'396 µs  1'689 µs  1'808 µs

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

• movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     546 ms/iter       (537 ms … 564 ms)    562 ms    564 ms    564 ms
Web Assembly: Latest       763 ms/iter       (755 ms … 784 ms)    781 ms    784 ms    784 ms
Web Assembly: Current      753 ms/iter       (746 ms … 771 ms)    755 ms    771 ms    771 ms
Node API: Current          469 ms/iter       (455 ms … 496 ms)    488 ms    496 ms    496 ms

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

• movies.findMany({ where: {...}, include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  75'565 µs/iter (74'711 µs … 77'569 µs) 75'726 µs 77'569 µs 77'569 µs
Web Assembly: Latest       108 ms/iter       (106 ms … 111 ms)    111 ms    111 ms    111 ms
Web Assembly: Current      105 ms/iter       (105 ms … 106 ms)    106 ms    106 ms    106 ms
Node API: Current       62'337 µs/iter (61'419 µs … 62'988 µs) 62'893 µs 62'988 µs 62'988 µs

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

• movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     967 ms/iter       (956 ms … 981 ms)    978 ms    981 ms    981 ms
Web Assembly: Latest     1'267 ms/iter   (1'258 ms … 1'285 ms)  1'278 ms  1'285 ms  1'285 ms
Web Assembly: Current    1'257 ms/iter   (1'245 ms … 1'279 ms)  1'273 ms  1'279 ms  1'279 ms
Node API: Current          875 ms/iter       (863 ms … 881 ms)    880 ms    881 ms    881 ms

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

• movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     137 ms/iter       (135 ms … 139 ms)    139 ms    139 ms    139 ms
Web Assembly: Latest       179 ms/iter       (178 ms … 180 ms)    179 ms    180 ms    180 ms
Web Assembly: Current      174 ms/iter       (174 ms … 175 ms)    174 ms    175 ms    175 ms
Node API: Current          106 ms/iter       (104 ms … 108 ms)    108 ms    108 ms    108 ms

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

• movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     877 µs/iter     (814 µs … 1'437 µs)    870 µs  1'373 µs  1'437 µs
Web Assembly: Latest     1'222 µs/iter   (1'157 µs … 1'854 µs)  1'221 µs  1'693 µs  1'854 µs
Web Assembly: Current    1'226 µs/iter   (1'172 µs … 2'210 µs)  1'220 µs  1'867 µs  2'210 µs
Node API: Current          730 µs/iter     (700 µs … 1'122 µs)    734 µs    815 µs  1'122 µs

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

• movie.findMany({ where: { cast: { person: { ... } }, take: 100 }) (m2m -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     874 µs/iter     (814 µs … 1'544 µs)    869 µs  1'365 µs  1'544 µs
Web Assembly: Latest     1'194 µs/iter   (1'140 µs … 1'825 µs)  1'199 µs  1'598 µs  1'825 µs
Web Assembly: Current    1'218 µs/iter   (1'158 µs … 1'683 µs)  1'222 µs  1'558 µs  1'683 µs
Node API: Current          791 µs/iter     (717 µs … 1'064 µs)    806 µs    853 µs  1'064 µs

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

After changes in 05e0213

@Druue Druue changed the title test(me): Empty dbgenerated() breaking for Unsupported() types test(se): Empty dbgenerated() breaking for Unsupported() types Apr 26, 2024
@Druue Druue marked this pull request as ready for review April 26, 2024 10:07
@Druue Druue changed the title test(se): Empty dbgenerated() breaking for Unsupported() types fix(se): Empty dbgenerated() breaking for Unsupported() types Apr 26, 2024
@Druue Druue added this to the 5.14.0 milestone Apr 26, 2024
Druue and others added 2 commits April 26, 2024 12:08
Empty `dbgenerated()` was fixed for supported types in
#3153 but that PR lacked
the corresponding changes for the unsupported types which this commit
adds.
Copy link
Contributor

@jkomyno jkomyno left a comment

Choose a reason for hiding this comment

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

Approved with a small nit

@Druue Druue merged commit 2f076be into main Apr 30, 2024
207 checks passed
@Druue Druue deleted the regr/15654 branch April 30, 2024 11:26
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.

Empty dbgenerated() still breaking for Unsupported() types
3 participants