Skip to content

[rails] Return database results with symbols instead of strings#791

Open
p8 wants to merge 2 commits into
MDA2AV:mainfrom
p8:rails/pg-symbol-results
Open

[rails] Return database results with symbols instead of strings#791
p8 wants to merge 2 commits into
MDA2AV:mainfrom
p8:rails/pg-symbol-results

Conversation

@p8
Copy link
Copy Markdown
Contributor

@p8 p8 commented Jun 3, 2026

Reuse symbols instead of creating new strings everytime.

Reuse symbols instead of creating new strings everytime.
@p8
Copy link
Copy Markdown
Contributor Author

p8 commented Jun 3, 2026

/benchmark -f rails --save

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

👋 /benchmark request received. A collaborator will review and approve the run.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

Benchmark Results

Framework: rails | Test: all tests

Test Conn RPS CPU Mem Δ RPS Δ Mem
baseline 512 78,005 5834.7% 8.3GiB -3.6% +22.1%
baseline 4096 33,059 4844.8% 6.4GiB -4.2% -3.0%
pipelined 512 303,954 6426.7% 2.4GiB -2.3% +9.1%
pipelined 4096 293,381 6417.6% 2.3GiB -1.9% ~0%
limited-conn 512 27,540 4597.3% 5.4GiB -0.9% +5.9%
limited-conn 4096 27,484 4681.4% 6.6GiB -0.3% +15.8%
json 4096 124,367 6419.2% 4.3GiB +2.9% +16.2%
json-comp 512 81,731 6435.2% 3.4GiB -2.6% -8.1%
json-comp 4096 85,272 6487.5% 4.2GiB +3.8% +10.5%
json-comp 16384 84,743 6483.5% 4.4GiB +0.4% -10.2%
json-tls 4096 114,275 6461.4% 4.2GiB +2.3% ~0%
upload 32 933 3062.6% 10.6GiB ~0% +8.2%
upload 256 893 6356.3% 8.2GiB -1.1% +1.2%
api-4 256 10,407 395.4% 438MiB +4.3% +41.7%
api-16 1024 27,271 1677.7% 1.3GiB +9.0% +52.3%
static 1024 123,522 6514.1% 9.4GiB +1.1% +62.1%
static 4096 124,833 6524.3% 9.5GiB +1.3% +58.3%
static 6800 121,170 6530.6% 9.6GiB -0.9% +60.0%
async-db 1024 73,527 6397.6% 3.6GiB +5.0% +24.1%
crud 4096 59,399 4350.6% 4.2GiB -3.3% -2.3%
Full log


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   14.03ms   13.20ms   20.70ms   35.00ms   200.70ms

  704007 requests in 10.00s, 704009 responses
  Throughput: 70.38K req/s
  Bandwidth:  292.39MB/s
  Status codes: 2xx=704009, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 704009 / 704009 responses (100.0%)
  Reconnects: 27682
  Per-template: 140422,141138,141258,141043,140148
  Per-template-ok: 140422,141138,141258,141043,140148
[info] CPU 6312.1% | Mem 3.7GiB

[run 2/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     1024 (16/thread)
  Pipeline:  1
  Req/conn:  25
  Templates: 5
  Expected:  200
  Duration:  10s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   13.26ms   13.10ms   20.00ms   28.10ms   36.50ms

  735269 requests in 10.00s, 735270 responses
  Throughput: 73.51K req/s
  Bandwidth:  305.51MB/s
  Status codes: 2xx=735270, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 735269 / 735270 responses (100.0%)
  Reconnects: 29152
  Per-template: 146745,147255,147409,147144,146716
  Per-template-ok: 146745,147255,147409,147144,146716
[info] CPU 6397.6% | Mem 3.6GiB

[run 3/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     1024 (16/thread)
  Pipeline:  1
  Req/conn:  25
  Templates: 5
  Expected:  200
  Duration:  10s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   13.53ms   13.30ms   20.40ms   28.30ms   36.90ms

  725950 requests in 10.00s, 725950 responses
  Throughput: 72.56K req/s
  Bandwidth:  301.58MB/s
  Status codes: 2xx=725950, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 725948 / 725950 responses (100.0%)
  Reconnects: 28722
  Per-template: 144756,145247,145754,145532,144659
  Per-template-ok: 144756,145247,145754,145532,144659
[info] CPU 6406.4% | Mem 3.6GiB

=== Best: 73527 req/s (CPU: 6397.6%, Mem: 3.6GiB) ===
[info] input BW: 4.91MB/s (avg template: 70 bytes)
[info] saved results/async-db/1024/rails.json
httparena-bench-rails
httparena-bench-rails

==============================================
=== rails / crud / 4096c (tool=gcannon) ===
==============================================
[info] waiting for server...
[info] server ready

[run 1/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     4096 (64/thread)
  Pipeline:  1
  Req/conn:  200
  Templates: 20
  Expected:  200
  Duration:  15s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   72.71ms   71.60ms   81.60ms   102.80ms   360.00ms

  814297 requests in 15.00s, 812052 responses
  Throughput: 54.13K req/s
  Bandwidth:  24.26MB/s
  Status codes: 2xx=812052, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 812052 / 812052 responses (100.0%)
  Reconnects: 1806
  Per-template: 40542,41023,40740,40359,40392,40553,40494,40634,40540,40675,40631,40343,40439,40609,40434,40607,40693,41054,40716,40574
  Per-template-ok: 40542,41023,40740,40359,40392,40553,40494,40634,40540,40675,40631,40343,40439,40609,40434,40607,40693,41054,40716,40574
[info] CPU 4292.1% | Mem 4.1GiB

[run 2/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     4096 (64/thread)
  Pipeline:  1
  Req/conn:  200
  Templates: 20
  Expected:  200
  Duration:  15s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   66.12ms   67.80ms   74.30ms   90.20ms   269.10ms

  893346 requests in 15.00s, 890989 responses
  Throughput: 59.39K req/s
  Bandwidth:  26.51MB/s
  Status codes: 2xx=890989, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 890988 / 890989 responses (100.0%)
  Reconnects: 3257
  Per-template: 44324,44944,44840,44750,44570,44624,44422,44334,44312,44567,44451,44381,44350,44850,44692,44400,43900,45457,44582,44238
  Per-template-ok: 44324,44944,44840,44750,44570,44624,44422,44334,44312,44567,44451,44381,44350,44850,44692,44400,43900,45457,44582,44238
[info] CPU 4350.6% | Mem 4.2GiB

[run 3/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     4096 (64/thread)
  Pipeline:  1
  Req/conn:  200
  Templates: 20
  Expected:  200
  Duration:  15s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   67.70ms   69.00ms   76.00ms   94.30ms   129.10ms

  880777 requests in 15.00s, 878492 responses
  Throughput: 58.55K req/s
  Bandwidth:  26.16MB/s
  Status codes: 2xx=878492, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 878491 / 878492 responses (100.0%)
  Reconnects: 3133
  Per-template: 43986,44124,43826,43669,43764,44002,43932,43971,43958,43869,43982,43833,43817,44066,43654,43954,43526,44933,43820,43805
  Per-template-ok: 43986,44124,43826,43669,43764,44002,43932,43971,43958,43869,43982,43833,43817,44066,43654,43954,43526,44933,43820,43805
[info] CPU 4406.7% | Mem 4.3GiB

=== Best: 59399 req/s (CPU: 4350.6%, Mem: 4.2GiB) ===
[info] input BW: 5.10MB/s (avg template: 90 bytes)
[info] saved results/crud/4096/rails.json
httparena-bench-rails
httparena-bench-rails
[info] skip: rails does not subscribe to fortunes
[info] skip: rails does not subscribe to baseline-h2
[info] skip: rails does not subscribe to static-h2
[info] skip: rails does not subscribe to baseline-h2c
[info] skip: rails does not subscribe to json-h2c
[info] skip: rails does not subscribe to baseline-h3
[info] skip: rails does not subscribe to static-h3
[info] skip: rails does not subscribe to gateway-64
[info] skip: rails does not subscribe to gateway-h3
[info] skip: rails does not subscribe to production-stack
[info] skip: rails does not subscribe to unary-grpc
[info] skip: rails does not subscribe to unary-grpc-tls
[info] skip: rails does not subscribe to stream-grpc
[info] skip: rails does not subscribe to stream-grpc-tls
[info] skip: rails does not subscribe to echo-ws
[info] skip: rails does not subscribe to echo-ws-pipeline
[info] rebuilding site/data/*.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/frameworks.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/api-16-1024.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/api-4-256.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/async-db-1024.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/baseline-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/baseline-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/crud-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-comp-16384.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-comp-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-comp-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-tls-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/limited-conn-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/limited-conn-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/pipelined-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/pipelined-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/static-1024.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/static-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/static-6800.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/upload-256.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/upload-32.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/current.json
[info] done
httparena-postgres
httparena-redis
[info] restoring loopback MTU to 65536

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.

1 participant