Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
GraphQL Ruby benchmark
Search
Fumiaki MATSUSHIMA
August 31, 2022
Programming
920
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GraphQL Ruby benchmark
GraphQL Tokyo #18 発表資料
https://www.meetup.com/ja-JP/graphql-tokyo/events/286913987/
Fumiaki MATSUSHIMA
August 31, 2022
More Decks by Fumiaki MATSUSHIMA
See All by Fumiaki MATSUSHIMA
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
140
Learning from performance improvements on GraphQL Ruby
mtsmfm
1
1.4k
Ruby で作る Ruby (物理)
mtsmfm
1
300
タイムアウトにご用心 / Timeout might break application state
mtsmfm
6
2.7k
Build REST API with GraphQL Ruby
mtsmfm
0
400
GraphQL Ruby をちょっとだけ速くした / Make graphql-ruby faster a bit
mtsmfm
1
800
Gaming PC on GCP
mtsmfm
0
810
How to introduce GraphQL to an existing React-Redux application
mtsmfm
1
330
Canary release in StudySapuri
mtsmfm
0
3.3k
Other Decks in Programming
See All in Programming
Building an Out-of-Order CPU
latte72
1
750
AIとGame Jamで、ゲームを完成させた話
takahirosaeki
0
120
MIZARU@SPAJAM2026 第二回予選
1901drama
0
110
Security issues being discussed on Web Platforms
petamoriken
0
750
型解析で実現する Go の言語内 DSL / Conference に Go! タイムテーブルの歩き方 for Gophers
mazrean
0
140
{ Android | Kotlin } Gradle Plugin in 2026
ryunen344
1
300
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
240
新卒PdEのリアル
ryu1013
1
490
App Intentsのビルドプロセスを支える技術
kntkymt
0
260
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
300
iOSDC Japan 2026 - Swiftで作って学ぼう!データベース自作入門
kaseken
2
110
週末にAI-DLCを本気で回したら$1,600溶けた
hbashimizu
0
130
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
464
34k
The Spectacular Lies of Maps
axbom
PRO
1
990
Statistics for Hackers
jakevdp
799
230k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Designing Powerful Visuals for Engaging Learning
tmiket
1
540
Un-Boring Meetings
codingconduct
0
410
Rails Girls Zürich Keynote
gr2m
96
14k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.9k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
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/