Skip to content

Instantly share code, notes, and snippets.

@cleverca22
Created February 3, 2019 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cleverca22/0bab7eb2836733c7136fef05f8ab34b1 to your computer and use it in GitHub Desktop.
Save cleverca22/0bab7eb2836733c7136fef05f8ab34b1 to your computer and use it in GitHub Desktop.
#!/bin/sh
echo cputime
jq < $1 '.cpuTime'
echo envs
jq < $1 '.envs | "num: \(.number) elements: \(.elements) mbyte: \(.bytes/1024/1024)"'
echo lists
jq < $1 '.list | "concats: \(.concats) elements: \(.elements) mbyte: \(.bytes/1024/1024)"'
echo values
jq < $1 '.values | "num: \(.number) mbyte: \(.bytes/1024/1024)"'
echo symbols
jq < $1 '.symbols | "num: \(.number) mbyte: \(.bytes/1024/1024)"'
echo sets
jq < $1 '.sets | "num: \(.number) elements: \(.elements) mbyte: \(.bytes/1024/1024)"'
echo
jq < $1 '"// used: \(.nrOpUpdates / 1000 | round)k times, copying \(.nrOpUpdateValuesCopied /1024 | round)k values"'
jq < $1 '"lookups: \(.nrLookups), thunks: \(.nrThunks)"'
jq < $1 '"prims called: \(.nrPrimOpCalls), funcs called: \(.nrFunctionCalls)"'
jq < $1 '.gc | "heap: \(.heapSize), total gbytes: \(.totalBytes/1024/1024/1024)"'
jq < $1 '.primops | to_entries | sort_by(.value) | reverse | .[0:4] | map("\(.key) called \(.value) times") | join(", ")'
#jq < $1 '.functions | sort_by(.count) | reverse | .[0:3] | map("\(.file):\(.line):\(.column) \(.name) ran \(.count)")'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment