Skip to content

Instantly share code, notes, and snippets.

@UnkindPartition
Created November 24, 2011 21:04
Show Gist options
  • Save UnkindPartition/1392285 to your computer and use it in GitHub Desktop.
Save UnkindPartition/1392285 to your computer and use it in GitHub Desktop.
Filtering GHC profile with awk
# Show the cost-centres with at least 2% accumulated time
% awk '$7 > 2' benchmark.prof
Thu Nov 24 22:56 2011 Time and Allocation Profiling Report (Final)
total time = 9.24 secs (462 ticks @ 20 ms)
total alloc = 6,124,320,224 bytes (excludes profiling overheads)
MAIN MAIN 1 0 0.0 0.0 100.0 100.0
main Main 322 1 0.0 0.0 100.0 100.0
=~ Text.Regex.Applicative.Interface 323 1 0.0 0.0 100.0 100.0
match Text.Regex.Applicative.Interface 324 1 0.0 0.0 100.0 100.0
step Text.Regex.Applicative.Object 339 800 9.5 4.2 52.4 9.2
addThread Text.Regex.Applicative.Object 344 21188900 5.8 4.2 42.9 5.0
insertUnique Text.Regex.Applicative.StateQueue 345 21188599 37.0 0.8 37.0 0.8
compile Text.Regex.Applicative.Object 325 1 0.0 0.0 47.6 90.8
compile Text.Regex.Applicative.Compile 331 1 0.0 0.0 47.6 90.8
compile2 Text.Regex.Applicative.Compile 332 4506 47.6 90.8 47.6 90.8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment