忙しい人向けに、.xcactivitylog
からメソッドのコンパイル時間を抽出するワンライナーです。
gunzip -c -S .xcactivitylog hoge.xcactivitylog | perl -pe "s/\r/\n/g" | grep -E "^\d+\.\d+ms" | sort -nr | uniq | head -100
中身はただのgzipですが、\r
が厄介なのでperl
で処理しています。
% gunzip -c -S .xcactivitylog *.xcactivitylog | perl -pe "s/\r/\n/g" | grep -E "^\d+\.\d+ms" | sort -nr | uniq | head -100 227.21ms .../Presentation/View/ToastView.swift:64:10 instance method showWithAnimation() 200.22ms .../Utility/DependencyAssembly.swift:12:22 class method setup() 192.17ms .../Presentation/ViewModel/Implementation/ColorSelectorViewModel.swift:75:10 instance method makeFlowLayout(with:) ...
もっと忙しい人向け
現在のディレクトリから最新のログを拾ってきます。便利〜♨
gunzip -c -S .xcactivitylog $(ls -lt | grep -E "\.xcactivitylog$" | head -1 | awk '{print $10}') | perl -pe "s/\r/\n/g" | grep -E "^\d+\.\d+ms" | sort -nr | uniq | head -100