mlprof(1)

πŸ“¦
version 20241230+git20251029 Β· 2 versions
, in arch rolling, nixos 26.05, nixpkgs unstable, ubuntu resolute, ubuntu stonking

πŸ’… mlprof(1) β€” the manual, but make it a group chat

okay so bestie, you know that thing where your MLton-compiled program is out here being slow or hogging memory and you're like "who did this"? mlprof is the friend who snitches. It's a General Commands Manual page, and I'm about to explain the whole thing to you with zero skips, no cap. πŸŽ€


✨ NAME ✨

mlprof β€” display profiling information for a MLton-compiled executable


🌸 SYNOPSIS 🌸

mlprof [option ...] a.out [mlmon.out ...]

πŸ¦‹ DESCRIPTION πŸ¦‹

mlprof extracts information from an executable compiled by MLton with -profile alloc or -profile time, plus the resulting mlmon.out file that got produced when you ran that executable. That's the whole vibe. πŸ’–

The output of mlprof starts with an initial line that tells you the total amount of CPU time or bytes allocated. Iconic opener. After that, source functions get listed along with the percentage of that total that they used, in decreasing order β€” so the biggest culprit is right there at the top, main character energy, no hiding. πŸ‘‘

If the program was compiled with -profile-stack true, mlprof will display the time spent or bytes allocated while the function was on the stack and in GC, in addition to the time or bytes that the function is directly responsible for. So you get the receipts and the receipts' receipts. 🧾

With multiple mlmon.out files, mlprof will sum the profiling information. Math bestie behavior. ✨


πŸ’… OPTIONS πŸ’…

  • -call-graph file β€” Write a call graph containing the table data to a dot file. See the MLton User Guide for details. πŸ“Š
  • -graph-title string β€” Set the call-graph title. Name your graph, let it have a personality. 🏷️
  • -gray {false|true} β€” Gray call-graph nodes according to stack %. This only makes sense if the executable was compiled -profile-stack true. Context matters, bestie. 🩢
  • -keep exp β€” Only show functions specified by exp. For details on the allowed expressions, see the MLton User Guide. Multiple -keep expressions are not allowed. Pick one, we're not doing a whole roster. πŸ™…β€β™€οΈ
  • -mlmon file β€” Process the list of whitespace-separated mlmon.out files found in the specified file. Bulk energy. πŸ“‹
  • -raw {false|true} β€” Show the raw counts in addition to the percentages. Numbers on numbers. πŸ”’
  • -show-line {false|true} β€” Show the file and line for each function. Location reveal, very sleuth. πŸ”
  • -split regexp β€” Treat duplicates of functions whose name matches regexp as different functions. Breaking them up so they can each shine separately. 🌈
  • -thresh x β€” An abbreviation for -keep '(thresh x)', which only prints information about functions whose percentage is greater than or equal to x, where 0 <= x <= 100.0. Filter out the small fry. 🍟
  • -tolerant {false|true} β€” Print a warning about broken mlmon.out files, but do not exit. Forgiving queen. It warns and then keeps it moving. 🫢
heads up bestie: -gray genuinely only makes sense if you compiled with -profile-stack true β€” otherwise you're graying things by a number that isn't there. And -keep will not let you stack multiple expressions, periodt.

πŸ‘€ SEE ALSO πŸ‘€

mlton(1) and the MLton Guide. Go read them, they're the lore. πŸ“š


and that's the whole page, bestie!! πŸ’–βœ¨πŸŒΈπŸ¦‹ This was mlprof(1) from the General Commands Manual, last touched December 30, 2024 β€” so go profile something and find out which function is being messy. Slay. πŸ’…πŸ‘‘