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
820
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
バクラクの認証基盤の成長と現在地 / bakuraku-authn-platform
convto
4
890
Асинхронная коммуникация в Go: от понятного к душному. Дима Некрасов, Otello, 2ГИС
lamodatech
0
1.7k
更新系と状態
uhyo
8
2.2k
グループ ポリシー再確認 (2)
murachiakira
0
210
製造業向けIoTソリューション提案資料.pdf
haruki_uiru
0
150
【Λ(らむだ)】最近のアプデ情報 / RPALT20250422
lambda
0
340
Databricksで完全履修!オールインワンレイクハウスは実在した!
akuwano
0
140
「経験の点」の位置を意識したキャリア形成 / Career development with an awareness of the “point of experience” position
pauli
4
130
Winning at PHP in Production in 2025
beberlei
1
270
AIとSREで「今」できること
honmarkhunt
3
690
白金鉱業Meetup_Vol.18_AIエージェント時代のUI/UX設計
brainpadpr
1
270
ガバクラのAWS長期継続割引 ~次の4/1に慌てないために~
hamijay_cloud
1
580
Featured
See All Featured
Site-Speed That Sticks
csswizardry
6
530
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
227
22k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
690
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
21k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.2k
It's Worth the Effort
3n
184
28k
Making the Leap to Tech Lead
cromwellryan
133
9.2k
Designing for humans not robots
tammielis
253
25k
The World Runs on Bad Software
bkeepers
PRO
68
11k
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.