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
900
1
Share
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
Learning from performance improvements on GraphQL Ruby
mtsmfm
1
1.3k
Ruby で作る Ruby (物理)
mtsmfm
1
270
タイムアウトにご用心 / Timeout might break application state
mtsmfm
6
2.7k
Build REST API with GraphQL Ruby
mtsmfm
0
390
GraphQL Ruby をちょっとだけ速くした / Make graphql-ruby faster a bit
mtsmfm
1
780
Gaming PC on GCP
mtsmfm
0
800
How to introduce GraphQL to an existing React-Redux application
mtsmfm
1
300
Canary release in StudySapuri
mtsmfm
0
3.2k
Analyze Rails CI
mtsmfm
2
1k
Other Decks in Programming
See All in Programming
t *testing.T は どこからやってくるの?
otakakot
1
710
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
230
UIの境界線をデザインする | React Tokyo #15 メイントーク
sasagar
2
380
Claude Codeをカスタムして自分だけのClaude Codeを作ろう
terisuke
0
140
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
4
420
Claude CodeでETLジョブ実行テストを自動化してみた
yoshikikasama
0
780
AIと共に生きる技術選定 2026
sgash708
0
110
Liberating Ruby's Parser from Lexer Hacks
ydah
2
2.1k
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
220
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
650
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
1
170
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
3
630
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Utilizing Notion as your number one productivity tool
mfonobong
4
290
Ruling the World: When Life Gets Gamed
codingconduct
0
210
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Fireside Chat
paigeccino
42
3.9k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
64
54k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
270
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
180
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.7k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
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/