-
Notifications
You must be signed in to change notification settings - Fork 186
Profiling TileDB Performance
Beka Davis edited this page Oct 25, 2022
·
6 revisions
Flamegraphs
$ perf script -F comm,pid,tid,cpu,time,event,ip,sym,dso,trace | stackcollapse-perf.pl --tid | c++filt > collapsed.txt
$ grep tilevcf collapsed.txt | flamegraph.pl > output.svg
- Open the Xcode App
- Click Xcode -> Open Developer Tool -> Instruments to open Instruments
- Note: Xcode does not need to be running once Instruments is open
- Check Xcode CLI version with
/usr/bin/xcodebuild --version
- If the Command Line Tools are not installed, run
xcode-select --install
Run an instrument profile trace and save the results to an output .trace file
instruments -t "<Instrument>" -D "<output_trace_destination>" python <executable>
Example: instruments -t "Time Profiler" -D "/tmp/pysc.trace" python ./tools/ingestor -x krasnow.h5ad --corestats
Note: for versions 13.0+, instruments
is removed from the Command Line Tools and replaced with xctrace
The .trace file will automatically be saved to the working directory
xctrace record --template '<Instrument>' --launch 'which python' -- <executable>
Example: xctrace record --template 'Time Profiler' --launch 'which python' -- ./tools/ingestor -x krasnow.h5ad --corestats
Example: xctrace record --template 'Time Profiler' --launch 'which python' -- foo.py
- Open the
.trace
file in Instruments - Highlight the section you want to analyze
- To remove highlight: View -> Clear Inspection Range
- In the Profile section, hold the Option key and click the arrow next to a Symbol Name to open / collapse its entire Call Tree