Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit aa76604

Browse files
authored
Merge branch 'main' into nginx-delay
2 parents 3097063 + 0dc903c commit aa76604

40 files changed

+543
-344
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"dockerfile": "Dockerfile",
1111
"context": ".."
1212
},
13-
"runArgs": ["-v", "/var/run/docker.sock:/var/run/docker.sock"],
13+
"runArgs": ["-v", "/var/run/docker.sock:/var/run/docker.sock", "--network=host"],
1414
"forwardPorts": [8000, 3000],
1515
"postCreateCommand": "bash ./setup.sh"
1616
}

.github/workflows/bench.yml

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,78 @@
11
name: "Run benchmark"
2-
32
on:
43
pull_request_target:
54
types: [assigned, opened, synchronize, reopened, edited]
65
push:
76
branches:
87
- main
9-
108
permissions:
119
contents: write
1210
pull-requests: write
1311
issues: write
14-
1512
jobs:
1613
build:
1714
runs-on: benchmarking-runner
1815
if: github.event.head_commit.message != 'Update performance results in README.md'
1916
env:
2017
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
strategy:
19+
matrix:
20+
service:
21+
[
22+
apollo_server,
23+
caliban,
24+
netflix_dgs,
25+
gqlgen,
26+
tailcall,
27+
async_graphql,
28+
hasura,
29+
graphql_jit,
30+
]
2131
steps:
2232
- name: Checkout (GitHub)
2333
uses: actions/checkout@v4
2434
with:
2535
token: ${{ secrets.GITHUB_TOKEN }}
2636
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
2737

28-
- name: Build devcontainer and run benchmarks
38+
- name: Build devcontainer and run setup and benchmark
2939
uses: devcontainers/[email protected]
3040
with:
3141
imageName: graphql-benchmarks
3242
push: never
3343
runCmd: |
34-
bash ./setup.sh
35-
bash ./run_benchmarks.sh
44+
bash ./graphql/${{ matrix.service }}/setup.sh
45+
bash run_benchmarks.sh ${{ matrix.service }}
46+
47+
- name: List benchmark files
48+
run: |
49+
ls -la bench*.txt || echo "No matching files found"
50+
51+
- name: Upload benchmark results
52+
uses: actions/upload-artifact@v3
53+
with:
54+
name: benchmark-results
55+
path: bench*.txt
56+
57+
analyze:
58+
needs: build
59+
runs-on: benchmarking-runner
60+
steps:
61+
- name: Checkout (GitHub)
62+
uses: actions/checkout@v4
63+
64+
- name: Download all benchmark results
65+
uses: actions/download-artifact@v3
66+
with:
67+
name: benchmark-results
68+
path: .
69+
70+
- name: List downloaded artifacts
71+
run: ls -la bench*.txt || echo "No matching files found"
72+
73+
- name: Analyze results
74+
run: |
75+
bash run_analyze_script.sh
3676
3777
- name: Print benchmark results
3878
run: cat ./results.md
@@ -51,4 +91,4 @@ jobs:
5191
with:
5292
branch: main
5393
commit_author: Author <[email protected]>
54-
commit_message: "Update performance results in README.md"
94+
commit_message: "[ci skip] update performance results in README.md"

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -51,32 +51,32 @@ Get started with the benchmarks:
5151
| Query | Server | Requests/sec | Latency (ms) | Relative |
5252
|-------:|--------:|--------------:|--------------:|---------:|
5353
| 1 | `{ posts { id userId title user { id name email }}}` |
54-
|| [Tailcall] | `29,865.00` | `3.34` | `112.98x` |
55-
|| [async-graphql] | `1,824.45` | `54.68` | `6.90x` |
56-
|| [Caliban] | `1,631.74` | `60.96` | `6.17x` |
57-
|| [Hasura] | `1,513.32` | `65.92` | `5.72x` |
58-
|| [GraphQL JIT] | `1,308.30` | `76.09` | `4.95x` |
59-
|| [Gqlgen] | `771.42` | `128.66` | `2.92x` |
60-
|| [Netflix DGS] | `360.56` | `174.79` | `1.36x` |
61-
|| [Apollo GraphQL] | `264.34` | `370.65` | `1.00x` |
54+
|| [Tailcall] | `27,894.20` | `3.57` | `116.40x` |
55+
|| [async-graphql] | `1,925.61` | `52.56` | `8.04x` |
56+
|| [Caliban] | `1,755.13` | `56.75` | `7.32x` |
57+
|| [GraphQL JIT] | `1,260.61` | `79.00` | `5.26x` |
58+
|| [Gqlgen] | `774.95` | `128.05` | `3.23x` |
59+
|| [Netflix DGS] | `363.59` | `177.99` | `1.52x` |
60+
|| [Apollo GraphQL] | `269.21` | `364.28` | `1.12x` |
61+
|| [Hasura] | `239.63` | `411.81` | `1.00x` |
6262
| 2 | `{ posts { title }}` |
63-
|| [Tailcall] | `61,611.40` | `1.61` | `45.11x` |
64-
|| [Caliban] | `9,406.21` | `10.99` | `6.89x` |
65-
|| [async-graphql] | `9,366.90` | `10.76` | `6.86x` |
66-
|| [Hasura] | `2,450.62` | `40.79` | `1.79x` |
67-
|| [Gqlgen] | `2,150.47` | `48.08` | `1.57x` |
68-
|| [Apollo GraphQL] | `1,745.86` | `57.22` | `1.28x` |
69-
|| [Netflix DGS] | `1,602.77` | `69.19` | `1.17x` |
70-
|| [GraphQL JIT] | `1,365.94` | `73.10` | `1.00x` |
63+
|| [Tailcall] | `57,871.20` | `1.72` | `78.98x` |
64+
|| [Caliban] | `10,019.30` | `10.31` | `13.67x` |
65+
|| [async-graphql] | `9,838.23` | `10.26` | `13.43x` |
66+
|| [Gqlgen] | `2,181.29` | `47.51` | `2.98x` |
67+
|| [Apollo GraphQL] | `1,743.58` | `57.29` | `2.38x` |
68+
|| [Netflix DGS] | `1,587.87` | `71.10` | `2.17x` |
69+
|| [GraphQL JIT] | `1,325.13` | `75.35` | `1.81x` |
70+
|| [Hasura] | `732.74` | `137.01` | `1.00x` |
7171
| 3 | `{ greet }` |
72-
|| [Caliban] | `69,058.50` | `1.06` | `27.21x` |
73-
|| [Tailcall] | `63,879.10` | `1.58` | `25.17x` |
74-
|| [async-graphql] | `50,746.10` | `2.10` | `20.00x` |
75-
|| [Gqlgen] | `46,935.70` | `5.11` | `18.50x` |
76-
|| [Netflix DGS] | `8,233.67` | `14.43` | `3.24x` |
77-
|| [Apollo GraphQL] | `8,028.37` | `12.66` | `3.16x` |
78-
|| [GraphQL JIT] | `5,097.42` | `19.59` | `2.01x` |
79-
|| [Hasura] | `2,537.66` | `39.39` | `1.00x` |
72+
|| [Caliban] | `67,294.20` | `1.11` | `26.65x` |
73+
|| [Tailcall] | `58,715.80` | `1.71` | `23.25x` |
74+
|| [Gqlgen] | `47,750.10` | `5.05` | `18.91x` |
75+
|| [async-graphql] | `46,947.60` | `2.15` | `18.59x` |
76+
|| [Netflix DGS] | `8,157.51` | `14.95` | `3.23x` |
77+
|| [Apollo GraphQL] | `8,061.32` | `12.58` | `3.19x` |
78+
|| [GraphQL JIT] | `5,041.54` | `19.80` | `2.00x` |
79+
|| [Hasura] | `2,524.95` | `40.06` | `1.00x` |
8080

8181
<!-- PERFORMANCE_RESULTS_END -->
8282

analyze.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash
22

3+
# Install gnuplot
4+
sudo apt-get update && sudo apt-get install -y gnuplot
5+
36
function extractMetric() {
47
local file="$1"
58
local metric="$2"
@@ -161,4 +164,4 @@ mv $latencyHistogramFile assets/
161164
# Delete the result TXT files
162165
for file in "${resultFiles[@]}"; do
163166
rm "$file"
164-
done
167+
done

assets/latency_histogram1.png

774 Bytes
Loading

assets/latency_histogram2.png

255 Bytes
Loading

assets/latency_histogram3.png

-161 Bytes
Loading

assets/req_sec_histogram1.png

-1.08 KB
Loading

assets/req_sec_histogram2.png

-951 Bytes
Loading

assets/req_sec_histogram3.png

-620 Bytes
Loading

graphql/apollo_server/package-lock.json

Lines changed: 12 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

graphql/apollo_server/setup.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
# For apollo server:
4+
cd graphql/apollo_server
5+
npm i
6+
cd ../../

0 commit comments

Comments
 (0)