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
350
PayPayフリマの速度改善
#wwdctokyo
himaratsu
June 08, 2021
Tweet
Share
More Decks by himaratsu
See All by himaratsu
Next.js × microCMSで道の駅サイトを作った話
himaratsu
0
840
Goodbye Code Review, Hello Pair Programming
himaratsu
0
180
使い勝手のよいCustomViewをつくる
himaratsu
0
630
UICollectionViewでインタラクティブなCellの並び替え
himaratsu
2
9.9k
Other Decks in Technology
See All in Technology
20250625 Snowflake Summit 2025活用事例 レポート / Nowcast Snowflake Summit 2025 Case Study Report
kkuv
1
300
Claude Code Actionを使ったコード品質改善の取り組み
potix2
PRO
6
2.2k
生成AIで小説を書くためにプロンプトの制約や原則について学ぶ / prompt-engineering-for-ai-fiction
nwiizo
3
920
変化する開発、進化する体系時代に適応するソフトウェアエンジニアの知識と考え方(JaSST'25 Kansai)
mizunori
1
210
AWS アーキテクチャ作図入門/aws-architecture-diagram-101
ma2shita
29
10k
AWS テクニカルサポートとエンドカスタマーの中間地点から見えるより良いサポートの活用方法
kazzpapa3
2
520
Welcome to the LLM Club
koic
0
160
Navigation3でViewModelにデータを渡す方法
mikanichinose
0
220
標準技術と独自システムで作る「つらくない」SaaS アカウント管理 / Effortless SaaS Account Management with Standard Technologies & Custom Systems
yuyatakeyama
3
1.2k
Agentic Workflowという選択肢を考える
tkikuchi1002
1
490
Кто отправит outbox? Валентин Удальцов, автор канала Пых
lamodatech
0
330
地図も、未来も、オープンに。 〜OSGeo.JPとFOSS4Gのご紹介〜
wata909
0
110
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
42
7.5k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
124
52k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Building an army of robots
kneath
306
45k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
Documentation Writing (for coders)
carmenintech
71
4.9k
Making the Leap to Tech Lead
cromwellryan
134
9.3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
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.