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
freee請求書プロダクトにおけるFiber活用/Utilization of Fiber...
Search
hachi (Hayao Kimura)
December 06, 2024
180
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
freee請求書プロダクトにおけるFiber活用/Utilization of Fiber in the freee Invoice Product
hachi (Hayao Kimura)
December 06, 2024
More Decks by hachi (Hayao Kimura)
See All by hachi (Hayao Kimura)
Integration of PRK Firmware and R2P2
hayaokimura
1
310
PicoRuby で拓く電子工作の世界/The World of Electronics Projects Opened by PicoRuby
hayaokimura
2
1.3k
RISC-V CPU emulator made with Ruby
hayaokimura
2
100
Ruby で作る RISC-V CPU エミュレーター / RISC-V CPU emulator made with Ruby
hayaokimura
5
2.2k
Fiber Scheduler vs. General-Purpose Parallel Client
hayaokimura
1
930
社内でGemを読む会をして捗っている/Progressing Well: A Gem Reading Session at Work
hayaokimura
1
79
Raw HID とOLEDで広げるキーボードの可能性/Expanding Keyboard Possibilities with Raw HID and OLED
hayaokimura
0
160
いいチームでいるためにやっていること/Things we are doing to remain a good team
hayaokimura
2
760
やりたいことを仕事でやる技術 / The Technique of Turning Your Passion into Your Profession
hayaokimura
0
12k
Featured
See All Featured
Thoughts on Productivity
jonyablonski
76
5.2k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Navigating Weather and Climate Data
rabernat
0
230
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
210
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
290
Why Our Code Smells
bkeepers
PRO
340
58k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.1k
How to Talk to Developers About Accessibility
jct
2
240
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
First, design no harm
axbom
PRO
2
1.2k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2k
Transcript
freee請求書プロダクトにおけるFiber活⽤ 2024.12.06
3⾏サマリ
Railsプロダクトで 並列リクエストを投げて 爆速ユーザー体験 🎉🎉🎉
freeeについて
…と思ったんですが
6
割愛!
freee請求書について
9
10 freee請求書とは ‧請求書をはじめとした各種帳票の作成‧管理‧送付サービス ‧もちろん電⼦帳簿保存法対応 ‧freee会計との連携で記帳もバッチリ ‧無料でも使えるので事業を始めたばかりでも安⼼
課題
12 CSVインポートのパフォーマンス ‧CSVから⼤量の請求書を作れる ‧社内の別サービスからの⼤量のデータ取得が遅い
解決策
14 並列リクエストによる社内サービス間データ取得 freee請求書 freee会計 Request A Request B Request C
Request D freee請求書 freee会計 Request A, B, C, D Before After
15 Faraday Em::Synchrony adapter ‧Faraday で em-synchrony を使えるadapter ‧em-synchrony gem:
‧EventMachine gem と Fiber を使って簡単に並⾏処理が書ける ‧Faraday::Connection#in_parallel で並列リクエスト可能に
実装
17 簡単に実装可能
結果
19 Before After
99.9%tile で倍の速さを実現 🎉🎉🎉 20
まとめ
22 まとめ ‧Faraday Em::Synchrony adapter で簡単並列リクエスト ‧ユーザーの体験が向上してハッピー ‧注意 ‧faraday-retry との相性
‧同時並列数の設定がない ‧可能なら async-http-faraday gem 使うほうがいいかも ‧faraday v2.5.0 以上が少なくとも必要そう
⾃⼰紹介とお知らせ
24 • freee 2022年4⽉⼊社 • 関⻄拠点所属 • freee でやってること
◦ freee請求書の開発 ◦ freee会計の開発 • 趣味 ◦ ダイビング、本、ゲーム、netflix ◦ Ruby、電⼦⼯作、キーボード hachi フリー株式会社 エンジニア ⽊村駿⽣/ Kimura Hayao
25
26 ⼤阪の Ruby コミュニティ Kyobashi.rb ‧昨⽇登壇した ydah san と⼀緒にやってます ‧毎⽉開催(したいと思っている)
‧⼤阪にお⽴ち寄りの際はぜひ参加してください
最後の最後に
28 ▶ freee新卒エンジニア募集中 本選考及び3Daysインターンシップ⽣を募集しています! 「ユーザー価値の追求」や「チームで作り上げていくこと」に 興味のある⽅、「シンプルにエンジニアリングが好き」な⽅は 是⾮⼀度説明会に遊びに来てください!お待ちしています! <対象> ‧2026年/2027年4⽉にご⼊社可能な⽅ ‧プログラミング経験(独学可)が3カ⽉以上の⽅
‧⼊社時点で29歳以下の⽅ 「🔍freee 新卒採⽤」で検索! 新卒エンジニアの 約50%が 地方大学出身!
スモールビジネスを、世界の主役に。