tailcallhq / tailcall

High Performance GraphQL Runtime
https://tailcall.run
Apache License 2.0
1.3k stars 257 forks source link

perf: small improvements in Synth #3051

Closed meskill closed 1 month ago

meskill commented 1 month ago

Summary:
Briefly describe the changes made in this PR.

Issue Reference(s):
Fixes #... (Replace "..." with the issue number)

Build & Testing:

Checklist:

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 85.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 87.37%. Comparing base (3d330e1) to head (d8d5ef6). Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/core/json/serde.rs 0.00% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3051 +/- ## ========================================== - Coverage 87.39% 87.37% -0.03% ========================================== Files 275 275 Lines 27149 27165 +16 ========================================== + Hits 23728 23735 +7 - Misses 3421 3430 +9 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 1 month ago

🐰 Bencher Report

Branch3051/merge
Testbedbenchmarking-runner

⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
from_json_bench📈 view plot
⚠️ NO THRESHOLD
6,249,200.00
group_by📈 view plot
⚠️ NO THRESHOLD
495.30
input/args.missing📈 view plot
⚠️ NO THRESHOLD
22.84
input/args.nested.existing📈 view plot
⚠️ NO THRESHOLD
43.17
input/args.nested.missing📈 view plot
⚠️ NO THRESHOLD
38.51
input/args.root📈 view plot
⚠️ NO THRESHOLD
38.80
input/headers.existing📈 view plot
⚠️ NO THRESHOLD
32.63
input/headers.missing📈 view plot
⚠️ NO THRESHOLD
31.82
input/value.missing📈 view plot
⚠️ NO THRESHOLD
23.74
input/value.nested.existing📈 view plot
⚠️ NO THRESHOLD
42.24
input/value.nested.missing📈 view plot
⚠️ NO THRESHOLD
35.38
input/value.root📈 view plot
⚠️ NO THRESHOLD
39.66
input/vars.existing📈 view plot
⚠️ NO THRESHOLD
8.16
input/vars.missing📈 view plot
⚠️ NO THRESHOLD
8.72
synth_nested📈 view plot
⚠️ NO THRESHOLD
104,160.00
synth_nested_borrow📈 view plot
⚠️ NO THRESHOLD
52,856.00
test_batched_body📈 view plot
⚠️ NO THRESHOLD
1,915.40
test_batched_body #2📈 view plot
⚠️ NO THRESHOLD
1,554,400.00
test_data_loader📈 view plot
⚠️ NO THRESHOLD
391,540.00
test_handle_request📈 view plot
⚠️ NO THRESHOLD
130,050.00
test_handle_request_jit📈 view plot
⚠️ NO THRESHOLD
64,012.00
test_http_execute_method📈 view plot
⚠️ NO THRESHOLD
15,374.00
with_mustache_expressions📈 view plot
⚠️ NO THRESHOLD
1,136.00
with_mustache_literal📈 view plot
⚠️ NO THRESHOLD
738.91
🐰 View full continuous benchmarking report in Bencher
meskill commented 1 month ago

RPS changes locally:

posts title

before

Running 30s test @ http://localhost:8000/graphql
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     2.95ms   14.36ms 486.95ms   99.11%
    Req/Sec    13.96k     2.02k   18.78k    89.16%
  1670008 requests in 27.10s, 8.37GB read
  Socket errors: connect 0, read 0, write 0, timeout 100
Requests/sec:  61623.45
Transfer/sec:    316.29MB

after

Running 30s test @ http://localhost:8000/graphql
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     2.89ms   15.14ms 551.80ms   99.09%
    Req/Sec    15.33k     2.66k   27.94k    85.63%
  1832428 requests in 27.66s, 9.18GB read
  Socket errors: connect 0, read 0, write 0, timeout 100
Requests/sec:  66243.75
Transfer/sec:    340.01MB

big query

before

Running 30s test @ http://localhost:8000/graphql
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    10.03ms    4.46ms 117.46ms   85.96%
    Req/Sec     2.59k     0.87k   16.07k    93.05%
  304120 requests in 29.64s, 15.04GB read
  Socket errors: connect 0, read 0, write 0, timeout 100
Requests/sec:  10259.24
Transfer/sec:    519.61MB

after

Running 30s test @ http://localhost:8000/graphql
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     9.26ms    3.05ms  68.16ms   75.51%
    Req/Sec     2.73k   236.40     3.05k    83.42%
  325544 requests in 30.05s, 16.10GB read
Requests/sec:  10832.93
Transfer/sec:    548.66MB