Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
GraphQL Ruby benchmark
Search
Fumiaki MATSUSHIMA
August 31, 2022
Programming
1
870
GraphQL Ruby benchmark
GraphQL Tokyo #18 発表資料
https://www.meetup.com/ja-JP/graphql-tokyo/events/286913987/
Fumiaki MATSUSHIMA
August 31, 2022
Tweet
Share
More Decks by Fumiaki MATSUSHIMA
See All by Fumiaki MATSUSHIMA
Learning from performance improvements on GraphQL Ruby
mtsmfm
1
1.2k
Ruby で作る Ruby (物理)
mtsmfm
1
250
タイムアウトにご用心 / Timeout might break application state
mtsmfm
6
2.6k
Build REST API with GraphQL Ruby
mtsmfm
0
370
GraphQL Ruby をちょっとだけ速くした / Make graphql-ruby faster a bit
mtsmfm
1
760
Gaming PC on GCP
mtsmfm
0
780
How to introduce GraphQL to an existing React-Redux application
mtsmfm
1
280
Canary release in StudySapuri
mtsmfm
0
3.2k
Analyze Rails CI
mtsmfm
2
980
Other Decks in Programming
See All in Programming
2026年 エンジニアリング自己学習法
yumechi
0
110
SourceGeneratorのススメ
htkym
0
160
CSC307 Lecture 02
javiergs
PRO
1
770
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
270
Vibe codingでおすすめの言語と開発手法
uyuki234
0
200
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
170
re:Invent 2025 のイケてるサービスを紹介する
maroon1st
0
170
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
390
CSC307 Lecture 03
javiergs
PRO
1
480
2年のAppleウォレットパス開発の振り返り
muno92
PRO
0
190
AIエージェントの設計で注意するべきポイント6選
har1101
7
3.3k
Graviton と Nitro と私
maroon1st
0
180
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
100
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
71k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
170
Balancing Empowerment & Direction
lara
5
860
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
300
BBQ
matthewcrist
89
10k
Transcript
@mtsmfm GraphQL Ruby ベンチマーク
松島 史秋 Backend engineer at Autify GitHub, Twitter @mtsmfm
https://autify.com/careers
https://www.meetup.com/ja-JP/GraphQL-Tokyo/
https://ninirb.github.io
大事なことは最初に - GraphQL Ruby v2.0.13 は 1000 要素あるとき に 1
フィールド足すと 15 ms くらい処理時間が 増える (2.60GHz CPU) - v2.0.13 は v1.5.15 と比べて倍くらい遅くなって いる - つまり倍くらい速くなる余地がある気がする
GraphQL Ruby なんか遅い?
https://speakerdeck.com/mtsmfm/make-graphql-ruby-faster-a-bit
https://speakerdeck.com/mtsmfm/make-graphql-ruby-faster-a-bit
前回得たこと、気になったこと - 1000 要素 4 フィールドで 60ms - 実際 4
フィールドしかないことはほぼない - 1 フィールドにつきどれくらいかかる? - 増えれば増えるほど遅くなる? - リリースごとだんだん遅くなってる?
ベンチマーク内容 type Article { field0: String! field1: String! ... fieldN:
String! } type Query { articles: [Article!]! } query { articles { field0, field1, ..., fieldN } }
ベンチマーク内容 type Article { field0: String! field1: String! ... fieldN:
String! } type Query { articles: [Article!]! } query { articles { field0, field1, ..., fieldN } } 要素数 フィールド数
ベンチマーク内容 - Query 文字列を渡して Ruby の Hash オブジェ クトが返ってくるまでの時間 -
30 秒を超えるまでループして処理時間と回数を 記録 - Ruby 2.7.6 - 古い GraphQL Ruby を動かすため 2 系
ベンチマーク環境 - GitHub Actions (ubuntu-latest) - Intel(R) Xeon(R) Platinum 8171M
CPU @ 2.60GHz - 2 コア - 具体的なスペックは引きによって変わることがあるかも - 全部 1 実行で回している - https://github.com/mtsmfm/graphql-ruby-benchmark
1 フィールドに つきどれくらい かかる?
None
1 フィールドにつきどれくらいかかる? - 1000 要素のとき、だいたい 15 ms くらい - 前回
1000 要素 4 フィールド 60 ms だったのでそれっ ぽい (マシンは違うけど) - フィールド数が少ないと 1 フィールドあたりの時 間が多い - おそらくクエリのパースとかの分 - 100 フィールド以降はほぼ変わらない
リリースごと だんだん遅く なってる?
https://github.com/mtsmfm/graphql-ruby-benchmark/blob/eaf93fb7ef10753d571eff13b635cf33167dcc03/graphql.rb 全バージョンで動くコードを書いた
None
None
GraphQL Ruby のバージョンごとの速度 - 1.1 と 1.5 は 1.8 以降の倍くらい速かった
- 最初期が最速ではなかった
None
ご清聴ありがとうございました - GraphQL Ruby v2.0.13 は 1000 要素あるとき に 1
フィールド足すと 15 ms くらい処理時間が 増える (2.60GHz CPU) - v2.0.13 は v1.5.15 と比べて倍くらい遅くなって いる - つまり倍くらい速くなる余地がある気がする
Credits Background pattern from Toptal Subtle Patterns https://www.toptal.com/designers/subtlepatterns/