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
Performance Testing using DTrace
Search
Renzo Crisóstomo
February 14, 2018
Programming
2
110
Performance Testing using DTrace
Slides from the presentation given at CocoaHeads Berlin February 2018 meet up.
Renzo Crisóstomo
February 14, 2018
Tweet
Share
More Decks by Renzo Crisóstomo
See All by Renzo Crisóstomo
Continuous Integration in a monorepo
ruenzuo
0
490
Secret History: xcconfig files
ruenzuo
0
58
!Introducing Swift in large code bases
ruenzuo
1
66
Scheduled Releases
ruenzuo
0
28
Other Decks in Programming
See All in Programming
Netty Chicago Java User Group 2024-04-17
sullis
0
200
"config" ってなんだ? / What is "config"?
okashoi
0
250
デフォルトにして至高、RubyMineの大好きな所
ruzia
0
700
Introducing Kotlin Multiplatform in an existing mobile app - Workshop Edition | AndroidMakers Paris
prof18
0
140
AmperとFleetを使ったAndroidアプリ
yoppie
0
250
#phpcon_odawara オープン・クローズドなテストフィクスチャを求めて / open closed test fixtures
77web
3
240
Fragment Composition of GraphQL
quramy
13
1.4k
スクラムガイドのスプリントレトロスペクティブを改めて読みかえしてみた / Re-reading the Sprint Retrospective Section in the Scrum Guide
mackey0225
3
480
2 週間で Twitter Bot を作ってみた
contour_gara
0
760
Exploring the Implementation of “t.Run”, “t.Parallel”, and “t.Cleanup”
akarin
1
110
単体テストを書かない技術 #phpcon_odawara
o0h
PRO
27
8.5k
Implementing Design Systems in Swift
seyfoyun
1
440
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
69
8.6k
Web Components: a chance to create the future
zenorocha
306
41k
Build The Right Thing And Hit Your Dates
maggiecrowley
25
2k
Visualization
eitanlees
137
14k
Navigating Team Friction
lara
179
13k
Music & Morning Musume
bryan
41
5.6k
Happy Clients
brianwarren
92
6.4k
Unsuck your backbone
ammeep
663
57k
Building Your Own Lightsaber
phodgson
100
5.7k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
26
2.3k
Pencils Down: Stop Designing & Start Developing
hursman
117
11k
Testing 201, or: Great Expectations
jmmastey
29
6.4k
Transcript
PERFORMANCE TESTING USING DTRACE
MOTIVATION
NON-FUNCTIONAL SOFTWARE REQUIREMENTS
BACKSTORY: XING.APP
MEASURING PERFORMANCE WITH XCODE > CACurrentMediaTime / mach_absolute_time() > dispatch_benchmark
> -[XCTestCase measureBlock:]
INSTRUMENTS.APP
None
None
DTRACE
D LANGUAGE provider:module:function:name / predicate / { action statements }
ASOCCIATIVE ARRAYS instr$target:::benchmark_begin { time = timestamp; tag = copyinstr(arg0);
tag_times[tag] = time; } instr$target:::benchmark_end / tag_times[copyinstr(arg0)] != 0 / { tag = copyinstr(arg0); time = (timestamp - tag_times[tag]); printf("%s:%d\n", tag, time); }
PROVIDERS pid1337:libdl:dlopen:return objc7331:NSDate:-dateByAddingTimeInterval?:entry proc:::exec-success
VARS > execname -> process name > pid -> current
pid > timestamp -> nanoseconds > args[0]...[N] -> probe arguments > probemod -> probe module > probefunc -> probe function
None
None
INSTRUMENTS.APP IN THE CLI > instruments > iprofiler > UIAutomation
ORCHESTRATION 1. Prepare the software 2. Run the software 3.
Run DTrace 4. Build performance report
instr
ORCHESTRATION 1. Prepare the software 2. Run the software 3.
Run DTrace 4. Build performance report
gem install instrumentality bundle exec instr profile $INSTRUMENT $TARGET_PROCESS (--interactive)
DEMO
CLOSING > /usr/share/examples/DTTk > Lots of information out there! objc.io,
Oracle, Apple, Facebook > Software instrumentation using the iOS Simulator is far from ideal > Run DTrace on your own systems and get surprised by what's happening!
LINKS > objc.io: DTrace > instr > Jenkins demo: GitHub