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
PayPayフリマの速度改善
Search
himaratsu
June 08, 2021
Technology
2
340
PayPayフリマの速度改善
#wwdctokyo
himaratsu
June 08, 2021
Tweet
Share
More Decks by himaratsu
See All by himaratsu
Next.js × microCMSで道の駅サイトを作った話
himaratsu
0
810
Goodbye Code Review, Hello Pair Programming
himaratsu
0
170
使い勝手のよいCustomViewをつくる
himaratsu
0
620
UICollectionViewでインタラクティブなCellの並び替え
himaratsu
2
9.9k
Other Decks in Technology
See All in Technology
AIと開発者の共創: エージェント時代におけるAIフレンドリーなDevOpsの実践
bicstone
1
250
”知のインストール”戦略:テキスト資産をAIの文脈理解に活かす
kworkdev
PRO
9
4.2k
AIエージェントの地上戦 〜開発計画と運用実践 / 2025/04/08 Findy W&Bミートアップ #19
smiyawaki0820
26
8.5k
低レイヤを知りたいPHPerのためのCコンパイラ作成入門 / Building a C Compiler for PHPers Who Want to Dive into Low-Level Programming
tomzoh
0
210
20250408 AI Agent workshop
sakana_ai
PRO
15
3.5k
開発視点でAWS Signerを考えてみよう!! ~コード署名のその先へ~
masakiokuda
3
140
AWS全冠芸人が見た世界 ~資格取得より大切なこと~
masakiokuda
1
280
Classmethod AI Talks(CATs) #21 司会進行スライド(2025.04.17) / classmethod-ai-talks-aka-cats_moderator-slides_vol21_2025-04-17
shinyaa31
0
450
食べログが挑む!飲食店ネット予約システムで自動テスト無双して手動テストゼロを実現する戦略
hagevvashi
1
160
古き良き Laravel のシステムは関数型スタイルでリファクタできるのか
leveragestech
1
640
От ручной разметки к LLM: как мы создавали облако тегов в Lamoda. Анастасия Ангелова, Data Scientist, Lamoda Tech
lamodatech
0
360
AIで進化するソフトウェアテスト:mablの最新生成AI機能でQAを加速!
mfunaki
0
120
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
Rebuilding a faster, lazier Slack
samanthasiow
80
8.9k
It's Worth the Effort
3n
184
28k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
13
1.4k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
4 Signs Your Business is Dying
shpigford
183
22k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.8k
RailsConf 2023
tenderlove
30
1.1k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
21k
Automating Front-end Workflow
addyosmani
1369
200k
Being A Developer After 40
akosma
91
590k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Transcript
©2021 Yahoo Japan Corporation All rights reserved. Update 起動体験 PayPayフリマの速度改善
ヤフー株式会社 CTO室アプリ統括部iOSアプリWG 平松亮介
©2021 Yahoo Japan Corporation All rights reserved. iOSエンジニア 前期まで︓PayPayフリマ iOS
今期から︓CTO室 / Core ML Twitter: @himara2 ⾃⼰紹介 2 平松 亮介
©2021 Yahoo Japan Corporation All rights reserved. このLTは PayPayフリマの起動速度を改善した話 3
©2021 Yahoo Japan Corporation All rights reserved. • ヤフーの各サービスで起動速度の改善に取り組んでいる •
PayPayフリマで実施した取り組みを紹介 • 起動速度のメンテナンスにCIを利⽤ 速度改善の取り組み 4
©2021 Yahoo Japan Corporation All rights reserved. PayPayフリマのホーム画⾯ 5
©2021 Yahoo Japan Corporation All rights reserved. PayPayフリマのホーム画⾯ 6 ݕࡧ૭
©2021 Yahoo Japan Corporation All rights reserved. PayPayフリマのホーム画⾯ 7 ݕࡧ૭
ԣεΫϩʔϧλϒ
©2021 Yahoo Japan Corporation All rights reserved. PayPayフリマのホーム画⾯ 8 ݕࡧ૭
ԣεΫϩʔϧλϒ Ωϟϯϖʔϯόφʔ
©2021 Yahoo Japan Corporation All rights reserved. PayPayフリマのホーム画⾯ 9 ݕࡧ૭
ԣεΫϩʔϧλϒ Ωϟϯϖʔϯόφʔ ϋογϡλάϦϯά ϑΥϩʔͯ͠Δλάͷ৽ண
©2021 Yahoo Japan Corporation All rights reserved. PayPayフリマのホーム画⾯ 10 ݕࡧ૭
ԣεΫϩʔϧλϒ Ωϟϯϖʔϯόφʔ ϋογϡλάϦϯά ϑΥϩʔͯ͠Δλάͷ৽ண ͓͢͢Ί
©2021 Yahoo Japan Corporation All rights reserved. 起動速度の計測(Watchful) 11
©2021 Yahoo Japan Corporation All rights reserved. 起動速度の計測(Watchful) 12 起動⾃体は
そこそこ速い
©2021 Yahoo Japan Corporation All rights reserved. 起動速度の計測(Watchful) 13 起動⾃体は
そこそこ速い コンテンツ表⽰に時間がかかっている
©2021 Yahoo Japan Corporation All rights reserved. APIリクエストの⾒直し 14
©2021 Yahoo Japan Corporation All rights reserved. • リリースから1年半で様々な機能が追加されてきた •
ボトルネックはどこか︖まずはグラフにしてみる 複雑化するホーム画⾯ 15
©2021 Yahoo Japan Corporation All rights reserved. 起動時に叩いているAPI 16 各種APIのendpoint
endpoint/api/1 endpoint/api/2 endpoint/api/3 …
©2021 Yahoo Japan Corporation All rights reserved. 17 起動時に叩いているAPI(主要API)
©2021 Yahoo Japan Corporation All rights reserved. 18 起動時に叩いているAPI(主要API) 直列に叩いてる部分
を⼯夫できそう
©2021 Yahoo Japan Corporation All rights reserved. • 0.5秒の短縮(17%の改善) APIリクエストを⾒直した結果
19
©2021 Yahoo Japan Corporation All rights reserved. コンテンツキャッシュ 20
©2021 Yahoo Japan Corporation All rights reserved. 21 コンテンツキャッシュ 初回
2回⽬ 以降 -BVODI $BDIFEDPOUFOUT /FUXPSLDPOUFOUT
©2021 Yahoo Japan Corporation All rights reserved. 22 コンテンツキャッシュ 初回
2回⽬ 以降 -BVODI $BDIFEDPOUFOUT /FUXPSLDPOUFOUT
©2021 Yahoo Japan Corporation All rights reserved. 23 コンテンツキャッシュ 初回
2回⽬ 以降 -BVODI $BDIFEDPOUFOUT /FUXPSLDPOUFOUT
©2021 Yahoo Japan Corporation All rights reserved. 24 コンテンツキャッシュ 初回
2回⽬ 以降 -BVODI $BDIFEDPOUFOUT /FUXPSLDPOUFOUT
©2021 Yahoo Japan Corporation All rights reserved. 25 コンテンツキャッシュ 初回
2回⽬ 以降 -BVODI $BDIFEDPOUFOUT /FUXPSLDPOUFOUT
©2021 Yahoo Japan Corporation All rights reserved. 26 コンテンツキャッシュ 初回
2回⽬ 以降 -BVODI $BDIFEDPOUFOUT /FUXPSLDPOUFOUT
©2021 Yahoo Japan Corporation All rights reserved. 27 コンテンツキャッシュ 初回
2回⽬ 以降 -BVODI $BDIFEDPOUFOUT /FUXPSLDPOUFOUT
©2021 Yahoo Japan Corporation All rights reserved. 28 コンテンツキャッシュ 初回
2回⽬ 以降 -BVODI $BDIFEDPOUFOUT /FUXPSLDPOUFOUT
©2021 Yahoo Japan Corporation All rights reserved. 29 コンテンツキャッシュ 初回
2回⽬ 以降 -BVODI $BDIFEDPOUFOUT /FUXPSLDPOUFOUT
©2021 Yahoo Japan Corporation All rights reserved. • ハッシュタグリング •
おすすめ商品 • ブランドランキング ※ログがおかしくならないように注意 キャッシュするもの 30
©2021 Yahoo Japan Corporation All rights reserved. • iOS 12+で使えるパフォーマンス測定のAPI
• Instruments や UI Testing で測定 計測︓OS Signpost 31
©2021 Yahoo Japan Corporation All rights reserved. • iOS 12+で使えるパフォーマンス測定のAPI
• Instruments や UI Testing で測定 • 今回の計測︓「最初の画像が表⽰されるまで」 計測︓OS Signpost 32
©2021 Yahoo Japan Corporation All rights reserved. 時間計測のコード
©2021 Yahoo Japan Corporation All rights reserved. 時間計測のコード
©2021 Yahoo Japan Corporation All rights reserved. 時間計測のコード
©2021 Yahoo Japan Corporation All rights reserved. UITestingで計測
©2021 Yahoo Japan Corporation All rights reserved. UITestingで計測
©2021 Yahoo Japan Corporation All rights reserved. 結果︓コンテンツキャッシュで⼤幅に改善 38 Wi-Fi
3G 2.13 5.45 Before After Improve 0.91 0.92 -1.22 -4.53 (単位︓秒 / iPhone 12 Pro 実機 / ⾃宅) • 「最初の画像が表⽰されるまで」の時間
©2021 Yahoo Japan Corporation All rights reserved. (動画)
©2021 Yahoo Japan Corporation All rights reserved. Static frameworksの利⽤ 40
©2021 Yahoo Japan Corporation All rights reserved. • Dynamic frameworks
→ Static frameworks • Podfileを⼀⾏変更 Static frameworksの利⽤ 41
©2021 Yahoo Japan Corporation All rights reserved. 起動時間の計測 42
©2021 Yahoo Japan Corporation All rights reserved. 起動時間の計測 43 Xcode
console
©2021 Yahoo Japan Corporation All rights reserved. 起動時間の計測 44 Xcode
console
©2021 Yahoo Japan Corporation All rights reserved. Static frameworksの利⽤で改善 45
Dynamic Static 1.2 Improve -0.2 1.0 (単位︓秒 / iPhone 12 Pro 実機 / ⾃宅) Dynamic, Static それぞれ3回の平均値
©2021 Yahoo Japan Corporation All rights reserved. • 本番環境では改善が⾒られず Xcode
OrganizerでMetricsを確認 46
©2021 Yahoo Japan Corporation All rights reserved. 1. APIリクエストの⾒直し 2.
コンテンツキャッシュ 3. Sta*c frameworksの利⽤ ここまで ある程度の速度改善ができた 47
©2021 Yahoo Japan Corporation All rights reserved. 1. APIリクエストの⾒直し 2.
コンテンツキャッシュ 3. Static frameworksの利⽤ ここまで ある程度の速度改善ができた 48 起動速度が遅くなった時に気づける仕組みが欲しい
©2021 Yahoo Japan Corporation All rights reserved. 1. 起動速度をUIテストで計測 2.
そのUIテストをCIで定期的に実⾏ 3. 速度の低下を検知したらSlackに投稿 速度の定期的な計測 49
©2021 Yahoo Japan Corporation All rights reserved. ワークフロー 50 コミット
GitHub 定期実⾏ CI上でUIテストで計測 遅くなったら Slackへの通知
©2021 Yahoo Japan Corporation All rights reserved. UITestingで起動速度を計測
©2021 Yahoo Japan Corporation All rights reserved. UITestingで起動速度を計測
©2021 Yahoo Japan Corporation All rights reserved. Slack通知
©2021 Yahoo Japan Corporation All rights reserved. • 計測と改善を繰り返し、起動速度を改善 •
起動速度が低下した時に検知する仕組みづくり • UITesting、Metrics周りのアップデートも楽しみですね︕ おわりに 54
©2021 Yahoo Japan Corporation All rights reserved.