tailcallhq / tailcall

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

perf: strip extra iteration when creating serde_json_borrow::Value #3087

Closed meskill closed 3 weeks ago

meskill commented 3 weeks ago

Summary:
Remove from_vec column in the base pr with reported flamegraph time around 1%

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

Build & Testing:

Checklist:

github-actions[bot] commented 3 weeks ago

🐰 Bencher Report

Branch3087/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,321,200.00
group_by📈 view plot
⚠️ NO THRESHOLD
496.44
input/args.missing📈 view plot
⚠️ NO THRESHOLD
23.04
input/args.nested.existing📈 view plot
⚠️ NO THRESHOLD
43.76
input/args.nested.missing📈 view plot
⚠️ NO THRESHOLD
38.10
input/args.root📈 view plot
⚠️ NO THRESHOLD
39.33
input/headers.existing📈 view plot
⚠️ NO THRESHOLD
32.67
input/headers.missing📈 view plot
⚠️ NO THRESHOLD
31.79
input/value.missing📈 view plot
⚠️ NO THRESHOLD
23.48
input/value.nested.existing📈 view plot
⚠️ NO THRESHOLD
43.71
input/value.nested.missing📈 view plot
⚠️ NO THRESHOLD
36.45
input/value.root📈 view plot
⚠️ NO THRESHOLD
42.55
input/vars.existing📈 view plot
⚠️ NO THRESHOLD
8.75
input/vars.missing📈 view plot
⚠️ NO THRESHOLD
8.71
synth_nested📈 view plot
⚠️ NO THRESHOLD
102,530.00
synth_nested_borrow📈 view plot
⚠️ NO THRESHOLD
37,760.00
test_batched_body📈 view plot
⚠️ NO THRESHOLD
1,932.00
test_batched_body #2📈 view plot
⚠️ NO THRESHOLD
1,511,300.00
test_data_loader📈 view plot
⚠️ NO THRESHOLD
389,250.00
test_handle_request📈 view plot
⚠️ NO THRESHOLD
131,640.00
test_handle_request_jit📈 view plot
⚠️ NO THRESHOLD
52,131.00
test_http_execute_method📈 view plot
⚠️ NO THRESHOLD
14,840.00
with_mustache_expressions📈 view plot
⚠️ NO THRESHOLD
1,106.90
with_mustache_literal📈 view plot
⚠️ NO THRESHOLD
718.27
🐰 View full continuous benchmarking report in Bencher
meskill commented 3 weeks ago

Measured RPS difference with wrk

posts title

before

base pr

Running 30s test @ http://localhost:8000/graphql
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     2.22ms   11.67ms 375.67ms   99.32%
    Req/Sec    18.13k     2.27k   24.50k    88.82%
  2169808 requests in 29.41s, 10.88GB read
  Socket errors: connect 0, read 0, write 0, timeout 99
Requests/sec:  73774.10
Transfer/sec:    378.66MB

serde_json_borrow without collect

Running 30s test @ http://localhost:8000/graphql
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     2.08ms   10.60ms 491.21ms   99.36%
    Req/Sec    17.71k     2.57k   26.88k    86.25%
  2118269 requests in 26.84s, 10.62GB read
  Socket errors: connect 0, read 0, write 0, timeout 100
Requests/sec:  78910.31
Transfer/sec:    405.02MB

big query

base pr

Running 30s test @ http://localhost:8000/graphql
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     9.10ms    4.07ms 109.28ms   88.04%
    Req/Sec     2.86k     1.09k   21.11k    98.98%
  334814 requests in 29.47s, 16.56GB read
  Socket errors: connect 0, read 0, write 0, timeout 100
Requests/sec:  11361.49
Transfer/sec:    575.43MB

serde_json_borrow without collect

Running 30s test @ http://localhost:8000/graphql
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     9.71ms    5.49ms 161.93ms   92.07%
    Req/Sec     2.65k   448.89     4.28k    81.55%
  317553 requests in 27.82s, 15.71GB read
  Socket errors: connect 0, read 0, write 0, timeout 100
Requests/sec:  11414.88
Transfer/sec:    578.14MB