RUBY-PROF(1)
π RUBY-PROF π
okay bestie, welcome to the ruby-prof manual page, aka the glow-up your slow Ruby script has been begging for π
this is section 1 of the manual, and it's about to be your new obsession.
β¨ NAME β¨
ruby-prof β a fast ruby profiler πβοΈπ¨
π SYNOPSIS π
ruby-prof options <script.rb> [--]
[profiled-script-command-line-options]
πΈ DESCRIPTION πΈ
So like, ruby-prof is a fast profiler for ruby. periodt. you can run it two ways: as a stand-alone program (which is literally what this man page is documenting, no cap) or as a ruby library π«Ά.
the way it works is so simple it's giving main character energy: just run the ruby program you wanna profile using ruby-prof:
ruby-prof script.rb
and at the end of execution, the time spent in each method gets displayed. that's it. that's the vibe check. π
π¦ OPTIONS π¦
-p,--printer=printerβ pick your printer, bestie:flatβ prints a flat profile as text (this is the default β¨).flat_with_line_numbersβ same as flat, but with line numbers π.graphβ prints a graph profile as text.graph_htmlβ prints a graph profile as html.call_treeβ format for KCacheGrind.call_stackβ prints a HTML visualization of the call tree π.dotβ prints a graph profile as a dot file.
-m,--min_percent=min_percentβ the minimum percent a method has to take before it gets included in output reports. > heads up: this option is not supported for call tree π-f,--file=pathβ output results to a file instead of standard out π.--mode=measure_modeβ select whatruby-profshould measure:processβ process time (the default π).wallβ wall time.cpuβ CPU time (Pentium and PowerPCs only).allocationsβ object allocations (requires a patched Ruby interpreter π§).memoryβ allocated memory in KB (requires a patched Ruby interpreter π§).gc_runsβ number of garbage collections (requires a patched Ruby interpreter π§).gc_timeβ time spent in garbage collection (requires a patched Ruby interpreter π§).
-s,--sort=sort_modeβ select howruby-profresults should be sorted:totalβ total timeselfβ self timewaitβ wait timechildβ child time
--replace-prognameβ replace$0when loading the.rbfiles.-vβ show version, set$VERBOSEto true, and profile script if option given π«-dβ set$DEBUGto true π-R,--require-noprof libβ require a specific library (and it's not profiled).-E,--eval-noprof codeβ execute the ruby statements (also not profiled).-x,--exclude regexpβ exclude methods by regexp (see method elimination π«).-X,--exclude-file fileβ exclude methods by regexp listed in file (see method elimination π«).--exclude-common-cyclesβ make common iterators likeInteger#timesappear inlined π.--exclude-common-callbacksβ make common callbacks invocations likeInteger#timesappear inlined so you can see call origins in graph ποΈ.-h,--helpβ show help message π.--versionβ show version0.13.1π·οΈ.
π COPYRIGHT π
ruby-prof was written by Shugo Maeda shugo@ruby-lang.org π«Ά.
this manual page was written by Arnaud Cornet arnaud.cornet@gmail.com and updated by Jonas Genannt jonas.genannt@capi2name.de for the Debian project (but like, it may be used by others too, sharing is caring π).
β SEE ALSO β
the ruby-prof website, https://github.com/ruby-prof/ruby-prof β go follow it, it's iconic π₯
and that's a wrap, bestie!! this page is from December 2013 and it's RUBY-PROF(1) in the manual β go profile something and slay π
β¨π
π¦ where this page comes from
- debian bookworm: ruby-prof 1.4.5-2 Β· BSD-2-Clause
- debian trixie: ruby-prof 1.7.0-1+b2 Β· BSD-2-Clause
- ubuntu jammy: ruby-prof 1.3.1-2build2 Β· BSD-2-Clause
- ubuntu noble: ruby-prof 1.4.5-2build2 Β· BSD-2-Clause
- ubuntu questing: ruby-prof 1.7.0-1build1
- ubuntu resolute: ruby-prof 1.7.2-1 Β· BSD-2-Clause
- ubuntu stonking: ruby-prof 2.0.5-1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms