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
1
140
freee請求書プロダクトにおけるFiber活用/Utilization of Fiber in the freee Invoice Product
hachi (Hayao Kimura)
December 06, 2024
Tweet
Share
More Decks by hachi (Hayao Kimura)
See All by hachi (Hayao Kimura)
RISC-V CPU emulator made with Ruby
hayaokimura
2
61
Ruby で作る RISC-V CPU エミュレーター / RISC-V CPU emulator made with Ruby
hayaokimura
5
1.7k
Fiber Scheduler vs. General-Purpose Parallel Client
hayaokimura
1
470
社内でGemを読む会をして捗っている/Progressing Well: A Gem Reading Session at Work
hayaokimura
1
48
Raw HID とOLEDで広げるキーボードの可能性/Expanding Keyboard Possibilities with Raw HID and OLED
hayaokimura
0
99
いいチームでいるためにやっていること/Things we are doing to remain a good team
hayaokimura
2
700
やりたいことを仕事でやる技術 / The Technique of Turning Your Passion into Your Profession
hayaokimura
0
8.4k
Drive Your Code ~ Building an RC Car by Writing Only Ruby~
hayaokimura
2
2.5k
仕事がしやすくなる社内発信のすすめ/ Work happily by tweeting
hayaokimura
8
27k
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1371
200k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Mobile First: as difficult as doing things right
swwweet
225
10k
Context Engineering - Making Every Token Count
addyosmani
8
300
How to train your dragon (web standard)
notwaldorf
97
6.3k
Product Roadmaps are Hard
iamctodd
PRO
55
11k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Building Adaptive Systems
keathley
44
2.8k
Keith and Marios Guide to Fast Websites
keithpitt
411
23k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
2.9k
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%が 地方大学出身!
スモールビジネスを、世界の主役に。