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
320
PayPayフリマの速度改善
#wwdctokyo
himaratsu
June 08, 2021
Tweet
Share
More Decks by himaratsu
See All by himaratsu
Next.js × microCMSで道の駅サイトを作った話
himaratsu
0
690
Goodbye Code Review, Hello Pair Programming
himaratsu
0
130
使い勝手のよいCustomViewをつくる
himaratsu
0
560
UICollectionViewでインタラクティブなCellの並び替え
himaratsu
2
9.4k
Other Decks in Technology
See All in Technology
[新卒向け研修資料] テスト文字列に「うんこ」と入れるな(2024年版)
infiniteloop_inc
4
16k
Delivering Millions of Messages within seconds @ Duolingo
pelelgrino
0
350
ChatGPT for IT Service Management (IT Pro)
dahatake
7
1.6k
Microsoft Intune 勉強会 第 2 回目
tamaiyutaro
1
150
DMM.com アルファ室採用案内資料
hsugita
1
170
Tellus の衛星データを見てみよう #mf_fukuoka
kongmingstrap
0
230
Building Dashboards as a Hobby
egmc
0
260
JSON攻略法.pdf
miyakemito
8
5.1k
プロトタイピングによる不確実性の低減 / Reducing Uncertainty through Prototyping
ohbarye
5
390
Janus
bkuhlmann
1
490
アクセシビリティを考慮したUI/CSSフレームワーク・ライブラリ選定
yajihum
2
1k
KubeConにproposalを送りたい人へのアドバイス
sat
PRO
3
260
Featured
See All Featured
Bash Introduction
62gerente
604
210k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
7
1k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
20
1.9k
Six Lessons from altMBA
skipperchong
21
3k
Thoughts on Productivity
jonyablonski
58
3.8k
Embracing the Ebb and Flow
colly
80
4.1k
Fireside Chat
paigeccino
21
2.6k
Gamification - CAS2011
davidbonilla
76
4.6k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
14
1.5k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
Docker and Python
trallard
34
2.7k
The World Runs on Bad Software
bkeepers
PRO
61
6.7k
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.