Skip to content

Instantly share code, notes, and snippets.

@naitoh
naitoh / falcon_benchmark_when_using_external_apis.md
Last active May 13, 2026 23:09
Falcon Benchmark When Using External APIs

Falcon Benchmark When Using External APIs

  • cc — concurrency(同時接続数)。ab -c に渡す値で、同時に何リクエストを投げるかを指定
  • reqs — total requests(総リクエスト数)。ab -n に渡す値で、1回のベンチマークで合計何リクエストを送るか

例えば cc=10 reqs=1000 は「10並列で計1000リクエストを送る」という意味。

$ bash benchmark/run_matrix.sh --markdown --long
$ ruby -v
ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [arm64-darwin24]
$ gem list strscan
*** LOCAL GEMS ***
strscan (default: 3.1.2)
$ benchmark-driver benchmark/rubykaigi_p39_check.yaml
Warming up --------------------------------------
@naitoh
naitoh / py2rb examples
Created February 1, 2019 12:32
py2rb master 0d2fbc5a86b82707a1d83241a21af6b2cc22c0b8
-- [python] ---------
* tests/algorithms/sqrt.py
def abs(x):
if x > 0:
return x
else:
return -x
def sqrt(x):
eps = 1e-10
@naitoh
naitoh / broadcast.py
Created November 18, 2018 04:23
Numo::NArray vs numpy performance. (CentOS 7(x64) Ruby 2.5.3 Numo::NArray 0.9.1.3, Python 3.6.5 numpy 1.15.4)
$ cat broadcast.py
from benchmarker import Benchmarker
import numpy as np
## specify number of loop
with Benchmarker(10000, width=20) as bench:
@bench(None) ## empty loop
def _(bm):
x = np.ones([1000,784], dtype=np.float32)