Code Monkey home page Code Monkey logo

pprof.jl's Introduction

PProf.jl

Build Status

Sometimes I need a hammer, sometimes I need a drill, this is a hammer-drill

using Profile
using PProf

# collect a profile
@profile peakflops()

# Export pprof profile and open interactive profiling web interface.
pprof()

This prints a link to a local webserver where you can inspect the profile you've collected. It produces a file called profile.pb.gz in the pprof format, and then opens the pprof tool in interactive "web" mode.

For more usage examples see the pprof docs: https://github.com/google/pprof/blob/master/doc/README.md

Dependencies

  • Graphviz
    • In order to use pprof's web graph view (which is one of the best parts of pprof), you need to have graphviz installed. Click the above link to install.

Usage

help?> pprof
  pprof([data, [lidict]];
          web = true, webhost = "localhost", webport = 57599,
          out = "profile.pb.gz", from_c = true, full_signatures = true, drop_frames = "",
          keep_frames = "", ui_relative_percentages = true, sampling_delay = nothing,
        )
  pprof(FlameGraphs.flamegraph(); kwargs...)

  Fetches the collected `Profile` data, exports to the `pprof` format, and (optionally) opens
  a `pprof` web-server for interactively viewing the results.
help?> @pprof
  @pprof ex

  Profiles the expression using @profile and starts or restarts the pprof() web UI with default arguments.

Calling pprof() or @pprof exports the profiling results to disk, and launches the web server in the background pointed at the results. Calling it again overwrites the results and refreshes the server, so you can reload the web-page to see your updated results. The link to the webserver is printed to your terminal, which you can then open in a browser.

If you manually modify the output profile file, you can refresh the web server without overwriting the out file by calling PProf.refresh().

Example

julia> using PProf

julia> @pprof peakflops()
"profile.pb.gz"

Main binary filename not available.
Serving web UI on http://localhost:57599

Google PProf Web View

graph

flamegraph

pprof.jl's People

Contributors

gdkrmr avatar github-actions[bot] avatar juliatagbot avatar nhdaly avatar vchuravy avatar vtjnash avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.