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
330
PayPayフリマの速度改善
#wwdctokyo
himaratsu
June 08, 2021
Tweet
Share
More Decks by himaratsu
See All by himaratsu
Next.js × microCMSで道の駅サイトを作った話
himaratsu
0
800
Goodbye Code Review, Hello Pair Programming
himaratsu
0
160
使い勝手のよいCustomViewをつくる
himaratsu
0
620
UICollectionViewでインタラクティブなCellの並び替え
himaratsu
2
9.8k
Other Decks in Technology
See All in Technology
20250307_エンジニアじゃないけどAzureはじめてみた
ponponmikankan
2
280
ライフステージの変化を乗り越える 探索型のキャリア選択
tenshoku_draft
2
500
開発者のための FinOps/FinOps for Engineers
oracle4engineer
PRO
2
300
「頑張る」を「楽しむ」に変換する技術
tomoyakitaura
11
1.9k
Global Databaseで実現するマルチリージョン自動切替とBlue/Greenデプロイ
j2yano
0
220
x86-64 Assembly Essentials
latte72
4
950
プルリクエストレビューを終わらせるためのチーム体制 / The Team for Completing Pull Request Reviews
nekonenene
4
2.1k
RaspberryPi CM4(CM5も)面白いぞ!
nonnoise
1
280
書籍『入門 OpenTelemetry』 / Intro of OpenTelemetry book
ymotongpoo
10
650
Microsoft_20250311_第2回AI_IoT共創ラボ.pdf
iotcomjpadmin
0
170
どうすると生き残れないのか/how-not-to-survive
hanhan1978
13
10k
Go Modulesの仕組み Bundler(Ruby)との比較を添えて
daisuketakeda
0
1.7k
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
99
5.4k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Typedesign – Prime Four
hannesfritz
41
2.5k
Embracing the Ebb and Flow
colly
84
4.6k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
134
33k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
YesSQL, Process and Tooling at Scale
rocio
172
14k
Adopting Sorbet at Scale
ufuk
75
9.2k
Docker and Python
trallard
44
3.3k
Faster Mobile Websites
deanohume
306
31k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
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.