prisma-engines icon indicating copy to clipboard operation
prisma-engines copied to clipboard

tech(engines): Add rust-toolchain

Open Druue opened this issue 2 years ago • 6 comments

We could also specify it as the following if we want to pin a specific version like we do in nix.

channel = "1.75.0"

But we currently also use channel = "stable" for the toolchain in prisma-schema-wasm

Rustup Book Info

Druue avatar Dec 22 '23 17:12 Druue

WASM Size

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

github-actions[bot] avatar Dec 22 '23 17:12 github-actions[bot]

CodSpeed Performance Report

Merging #4611 will not alter performance

:warning: No base runs were found

Falling back to comparing tech/rust-toolchain (b2225da) with main (01382e5)

Summary

✅ 11 untouched benchmarks

codspeed-hq[bot] avatar Dec 22 '23 18:12 codspeed-hq[bot]

✅ 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  303.01 ms/iter (300.38 ms … 314.02 ms) 302.82 ms 314.02 ms 314.02 ms
Web Assembly: Latest     302.2 ms/iter (300.67 ms … 307.97 ms) 302.05 ms 307.97 ms 307.97 ms
Web Assembly: Current   305.45 ms/iter    (302 ms … 318.88 ms)  305.4 ms 318.88 ms 318.88 ms
Node API: Current       232.49 ms/iter (226.58 ms … 243.33 ms) 236.46 ms 243.33 ms 243.33 ms

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

• movies.findMany({ take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   12.24 ms/iter   (11.82 ms … 14.33 ms)  12.23 ms  14.33 ms  14.33 ms
Web Assembly: Latest     13.14 ms/iter   (12.09 ms … 22.35 ms)  12.61 ms  22.35 ms  22.35 ms
Web Assembly: Current    12.65 ms/iter   (11.94 ms … 19.15 ms)  12.37 ms  19.15 ms  19.15 ms
Node API: Current         9.49 ms/iter    (9.04 ms … 11.66 ms)   9.53 ms  11.66 ms  11.66 ms

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

• movies.findMany({ where: {...}, take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline       2 ms/iter     (1.83 ms … 3.52 ms)   1.94 ms   3.44 ms   3.44 ms
Web Assembly: Latest      2.05 ms/iter     (1.84 ms … 3.61 ms)   1.96 ms   3.41 ms   3.45 ms
Web Assembly: Current     2.06 ms/iter      (1.86 ms … 3.5 ms)   1.98 ms   3.39 ms   3.41 ms
Node API: Current         1.53 ms/iter     (1.44 ms … 2.15 ms)   1.55 ms   2.03 ms   2.07 ms

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

• movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   12.14 ms/iter    (11.8 ms … 12.99 ms)  12.23 ms  12.99 ms  12.99 ms
Web Assembly: Latest     12.36 ms/iter   (12.06 ms … 13.83 ms)  12.31 ms  13.83 ms  13.83 ms
Web Assembly: Current    12.25 ms/iter    (11.98 ms … 12.7 ms)  12.33 ms   12.7 ms   12.7 ms
Node API: Current         9.77 ms/iter    (9.18 ms … 17.94 ms)   9.59 ms  17.94 ms  17.94 ms

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

• movies.findMany({ where: {...}, include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     1.9 ms/iter     (1.81 ms … 3.14 ms)   1.89 ms   2.45 ms   2.61 ms
Web Assembly: Latest       1.9 ms/iter     (1.83 ms … 4.44 ms)   1.89 ms   2.79 ms   3.15 ms
Web Assembly: Current     1.92 ms/iter      (1.84 ms … 3.1 ms)   1.91 ms   2.81 ms   2.88 ms
Node API: Current         1.55 ms/iter     (1.45 ms … 2.21 ms)   1.57 ms   1.74 ms   1.76 ms

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

• movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   12.28 ms/iter   (11.83 ms … 15.52 ms)  12.23 ms  15.52 ms  15.52 ms
Web Assembly: Latest     12.15 ms/iter   (12.04 ms … 12.57 ms)  12.17 ms  12.57 ms  12.57 ms
Web Assembly: Current    12.24 ms/iter   (11.86 ms … 16.87 ms)  12.24 ms  16.87 ms  16.87 ms
Node API: Current          9.3 ms/iter     (8.96 ms … 9.84 ms)   9.35 ms   9.84 ms   9.84 ms

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

• movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline    1.93 ms/iter      (1.81 ms … 2.9 ms)   1.92 ms   2.87 ms    2.9 ms
Web Assembly: Latest      2.02 ms/iter     (1.81 ms … 4.68 ms)   1.93 ms      4 ms   4.61 ms
Web Assembly: Current     1.89 ms/iter     (1.82 ms … 2.44 ms)   1.89 ms   2.34 ms   2.36 ms
Node API: Current         1.57 ms/iter     (1.47 ms … 2.07 ms)   1.58 ms   1.82 ms      2 ms

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

• movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  938.17 µs/iter   (858.06 µs … 1.59 ms) 925.14 µs   1.51 ms   1.58 ms
Web Assembly: Latest    922.55 µs/iter   (847.17 µs … 3.13 ms) 916.68 µs   1.41 ms   1.48 ms
Web Assembly: Current   924.05 µs/iter   (859.08 µs … 1.57 ms) 919.58 µs   1.45 ms   1.53 ms
Node API: Current       819.43 µs/iter   (762.78 µs … 1.11 ms) 853.15 µs 990.13 µs   1.01 ms

summary for movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
  Web Assembly: Current
   1.13x 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   935.7 µs/iter   (887.33 µs … 1.48 ms) 935.22 µs   1.28 ms   1.31 ms
Web Assembly: Latest    897.56 µs/iter   (852.91 µs … 1.45 ms) 899.71 µs   1.18 ms    1.2 ms
Web Assembly: Current   904.76 µs/iter   (864.23 µs … 2.25 ms) 905.55 µs   1.36 ms   1.56 ms
Node API: Current       848.29 µs/iter   (762.56 µs … 1.04 ms) 864.32 µs 996.46 µ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.03x faster than Web Assembly: Baseline

After changes in b2225dafc14420afdd7e378217252164c84d7814

github-actions[bot] avatar Dec 22 '23 18:12 github-actions[bot]

Hi, is there a Slack conversation this PR is inspired from? I'm just trying to understand what prompted this PR, before reviewing that.

jkomyno avatar Dec 26 '23 11:12 jkomyno

@jkomyno

Hi, is there a Slack conversation this PR is inspired from? I'm just trying to understand what prompted this PR, before reviewing that.

Slack thread

Druue avatar Jan 02 '24 13:01 Druue

🤔 image

Druue avatar Jan 03 '24 14:01 Druue