Skip to content

Instantly share code, notes, and snippets.

@jvns
Last active March 15, 2024 20:19
Show Gist options
  • Save jvns/b81eb039f6373bc577d7dbdd978581b5 to your computer and use it in GitHub Desktop.
Save jvns/b81eb039f6373bc577d7dbdd978581b5 to your computer and use it in GitHub Desktop.

Ruby and Python profilers

CPU profilers

Python

Ruby

heap analyzers / memory profilers

Ruby

blog posts about memory profiling: (from https://twitter.com/b0rk/status/957994325476036613)

Python

Frontends

various tools for injecting code into ruby / python processes or tracing

(definitely out of scope, but interesting)

ideas/thoughts by email

  • automatically save results to disk (cf https://github.com/garybernhardt/readygo)
  • give profiling results on the fly, instead of making the user wait for the end of the run
  • ability to use it in production is key
  • "I am working on a Rust thing to make Rails faster and am frustrated that I can't use the same profiling tools to measure before/after. (Instruments can't see into Ruby, stackprof can't see past FFI) "
  • "the things that ruby has been missing since forever are":
    • a way to get a stacktrace dump of all threads (which is easy)
    • information about which thread was running at the time of said dump
    • information about which threads are actively trying to get scheduled (e.g. they have work to do), threads that are waiting on IO to complete, and threads that are waiting for mutexes to become available.
@mdesantis
Copy link

Here there is a gdb integration: https://github.com/david942j/gdb-ruby

@williame
Copy link

Here's one suitable for profiling long-running servers: https://williamedwardscoder.tumblr.com/post/35134924139/a-novel-profiler-for-python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment