All Projects → asottile → Importtime Waterfall

asottile / Importtime Waterfall

Licence: mit
Generate waterfalls from `-Ximporttime` tracing.

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Importtime Waterfall

Clockwork Chrome
Clockwork - php dev tools integrated to your browser - Chrome extension
Stars: ✭ 415 (+615.52%)
Mutual labels:  profiling
Conprof
Continuous profiling for performance analysis of CPU, memory over time.
Stars: ✭ 571 (+884.48%)
Mutual labels:  profiling
Scalopus
A tracing framework for C++ and Python.
Stars: ✭ 41 (-29.31%)
Mutual labels:  profiling
Processhacker
A free, powerful, multi-purpose tool that helps you monitor system resources, debug software and detect malware.
Stars: ✭ 6,285 (+10736.21%)
Mutual labels:  profiling
Go Profiler Notes
felixge's notes on the various go profiling methods that are available.
Stars: ✭ 525 (+805.17%)
Mutual labels:  profiling
Viztracer
VizTracer is a low-overhead logging/debugging/profiling tool that can trace and visualize your python code execution.
Stars: ✭ 874 (+1406.9%)
Mutual labels:  profiling
Tufte
Simple profiling and performance monitoring for Clojure/Script
Stars: ✭ 401 (+591.38%)
Mutual labels:  profiling
Jsbench Me
jsbench.me - JavaScript performance benchmarking playground
Stars: ✭ 50 (-13.79%)
Mutual labels:  profiling
Wtrace
Command line tracing tool for Windows, based on ETW.
Stars: ✭ 563 (+870.69%)
Mutual labels:  profiling
Likwid
Performance monitoring and benchmarking suite
Stars: ✭ 957 (+1550%)
Mutual labels:  profiling
Pyheat
pprofile + matplotlib = Python program profiled as an awesome heatmap!
Stars: ✭ 491 (+746.55%)
Mutual labels:  profiling
Austin
Python frame stack sampler for CPython
Stars: ✭ 547 (+843.1%)
Mutual labels:  profiling
Java Debug Tool
Java dynamic debug tool
Stars: ✭ 26 (-55.17%)
Mutual labels:  profiling
Trace Nodejs
Trace is a visualised distributed tracing platform designed for microservices.
Stars: ✭ 471 (+712.07%)
Mutual labels:  profiling
Echo Pprof
echo-pprof is a wrapper for golang web framework echo to use net/http/pprof easily.
Stars: ✭ 40 (-31.03%)
Mutual labels:  profiling
Plibsys
Highly portable C system library: threads and synchronization primitives, sockets (TCP, UDP, SCTP), IPv4 and IPv6, IPC, hash functions (MD5, SHA-1, SHA-2, SHA-3, GOST), binary trees (RB, AVL) and more. Native code performance.
Stars: ✭ 402 (+593.1%)
Mutual labels:  profiling
Redis Memory Analyzer
Redis memory profiler to find the RAM bottlenecks throw scaning key space in real time and aggregate RAM usage statistic by patterns.
Stars: ✭ 591 (+918.97%)
Mutual labels:  profiling
Observer cli
Visualize Erlang/Elixir Nodes On The Command Line
Stars: ✭ 1,058 (+1724.14%)
Mutual labels:  profiling
Etrace
Emacs Lisp Latency Tracing for the Chromium Catapult Trace Event Format
Stars: ✭ 45 (-22.41%)
Mutual labels:  profiling
Py Spy
Sampling profiler for Python programs
Stars: ✭ 7,709 (+13191.38%)
Mutual labels:  profiling

Build Status pre-commit.ci status

importtime-waterfall

Generate waterfalls from -Ximporttime tracing.

install

pip install importtime-waterfall

note: importtime-waterfall requires python3.7+

usage

importtime-waterfall provides a single executable by the same name.

importtime-waterfall takes a module name as a positional argument. This is the module that will be profiled.

--include-interpreter-startup

Include tracing information of modules that are always imported as part of interpreter startup. These are usually not interesting and so they are left out by default.

--har

Output as an HTTP Archive or "HAR" file. Yes these aren't actual HTTP requests but it's an easy way to get a visualization using a standardized data format.

HAR unfortunaly doesn't have microsecond resolution so all times in the HAR output are * 1000 (1 μs => 1ms).

The easiest way to use the output of this is to paste it into a har viewer.

I use the following:

$ importtime-waterfall importtime_waterfall --har | xclip -selection c

xclip takes the output and puts it onto the clipboard. Alternatively, you can redirect to a file (> foo.har) and upload it that way.

Once pasted into the viewer you can inspect the output.

The blocked import time is represented as "waiting" (purple) and the self time is represented as "receiving" (grey). Generally when looking for slow modules look for ones with large grey chunks.

--graph

(this is the default display). Display the output as a tree. This doesn't really add much on top of what python -Ximporttime already displays (but was useful for developing / debugging this tool). I guess it's in human order instead of reversed so that's something 🤷.

Times displayed next to the module names are self-times in μs.

$ importtime-waterfall importtime_waterfall
importtime_waterfall (419)
  argparse (864)
    re (599)
      enum (661)
      sre_compile (270)
        _sre (109)
        sre_parse (336)
          sre_constants (339)
      copyreg (161)
    gettext (1056)
      locale (820)
  datetime (768)
    time (234)
    math (57)
    _datetime (154)
  json (254)
    json.decoder (446)
      json.scanner (481)
        _json (193)
    json.encoder (443)
  subprocess (628)
    signal (1030)
    errno (101)
    _posixsubprocess (40)
    select (51)
    selectors (543)
      collections.abc (184)
    threading (578)
      traceback (394)
        linecache (162)
          tokenize (911)
            token (178)
      _weakrefset (217)
  typing (1469)

success stories

I used this to find a 24% speedup in flake8's startup.

nitty-gritty how it works

importtime-waterfall imports the profiled module in a subprocess while setting the -Ximporttime flag. importtime-waterfall picks the best-of-5 (by total time) and uses that result. It parses the "import time:" lines and then outputs.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].