signpostsによるパフォーマンス計測

9aae0d43a001b7a1bc459bee08c0a24c?s=47 Shohei Yokoyama
June 20, 2018
300

 signpostsによるパフォーマンス計測

9aae0d43a001b7a1bc459bee08c0a24c?s=128

Shohei Yokoyama

June 20, 2018
Tweet

Transcript

  1. signpostsʹΑΔύϑΥʔϚϯεܭଌ גࣜձࣾAbemaTV / shoheiyokoyama

  2. ԣࢁ঵ฏ גࣜձࣾAbemaTV GitHub: shoheiyokoyama Twi$er: shoheiyokoyam

  3. Measuring Performance Using Logging WWDC 2018 h"ps:/ /developer.apple.com/videos/play/wwdc2018/405/

  4. Signposts • ύϑΥʔϚϯε΍Πϕϯτͷଌఆ͕Մೳ • OSLogΛ֦ுͨ͠API • InstrumentsͰ֬ೝՄೳ

  5. 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")
  6. 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") } }
  7. 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) } }
  8. Custom Metadata C-APIϥΠΫʹϝλ৘ใΛෳ਺ࢦఆՄೳ(CVarArg) os_signpost(.begin, log: log, name: name, signpostID: signpostID,

    "%s, %d", description, number)
  9. Demo h"ps:/ /github.com/shoheiyokoyama/DebuggingPerformance