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
signpostsによるパフォーマンス計測
Search
Shohei Yokoyama
June 20, 2018
450
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
signpostsによるパフォーマンス計測
Shohei Yokoyama
June 20, 2018
More Decks by Shohei Yokoyama
See All by Shohei Yokoyama
Image Processing with Vision Framework
shoheiyokoyama
2
2k
LLDB Debugging
shoheiyokoyama
2
1.9k
OSS development tips for iOS
shoheiyokoyama
0
280
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Un-Boring Meetings
codingconduct
0
380
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
470
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.7k
Into the Great Unknown - MozCon
thekraken
41
2.7k
From π to Pie charts
rasagy
0
260
Claude Code のすすめ
schroneko
67
230k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
200
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
430
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
ラッコキーワード サービス紹介資料
rakko
1
4.3M
GitHub's CSS Performance
jonrohan
1033
470k
Transcript
signpostsʹΑΔύϑΥʔϚϯεܭଌ גࣜձࣾAbemaTV / shoheiyokoyama
ԣࢁฏ גࣜձࣾAbemaTV GitHub: shoheiyokoyama Twi$er: shoheiyokoyam
Measuring Performance Using Logging WWDC 2018 h"ps:/ /developer.apple.com/videos/play/wwdc2018/405/
Signposts • ύϑΥʔϚϯεΠϕϯτͷଌఆ͕Մೳ • OSLogΛ֦ுͨ͠API • InstrumentsͰ֬ೝՄೳ
Measuring Intervals import os.signpost let log = OSLog(subsystem: "com.example.app", category:
"SomeOperation") os_signpost(.begin, log: log, name: "doSomething") doSomething() os_signpost(.end, log: log, name: "doSomething")
Measuring Asynchronous Intervals import os.signpost let log = OSLog(subsystem: "com.example.app",
category: "SomeOperation") for element in elements { os_signpost(.begin, log: log, name: "doSomething") // Asynchronously doSomething(element) { // Measuring may fail ! os_signpost(.end, log: log, name: "doSomething") } }
Measuring Asynchronous Intervals import os.signpost let log = OSLog(subsystem: "com.example.app",
category: "SomeOperation") for element in elements { let signpostID = OSSignpostID(log: log) os_signpost(.begin, log: log, name: "doSomething", signpostID: signpostID) // Asynchronously doSomething(element) { os_signpost(.end, log: log, name: "doSomething", signpostID: signpostID) } }
Custom Metadata C-APIϥΠΫʹϝλใΛෳࢦఆՄೳ(CVarArg) os_signpost(.begin, log: log, name: name, signpostID: signpostID,
"%s, %d", description, number)
Demo h"ps:/ /github.com/shoheiyokoyama/DebuggingPerformance