Code Monkey home page Code Monkey logo

vscode-speedscope's Introduction

Speedscope VS Code Extension

Open 🔬Speedscope profiles in VS Code and jump to the source code of the profiled functions.

Features

Open a speedscope profiles from VS Code Explorer

Open a speedscope profile

Menu item available for .json, .txt, .log, .prof, .cpuprofile and .heapprofile extensions.

Jump to the source code of the profiled functions

Jump to the source code

Use Crtl+Click on the function name in the flamegraph to jump to the source code.

Show speedscope app in side view with ability to open local files

Show speedscope in side view

Use Ctrl+Shift+P and type Show Speedscope to open speedscope in side view.

Usage examples

Profiling with py-spy

Here is example of profiling automation with py-spy. Add following lines to your tasks.json file:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Profile isort",
            "type": "process",
            "command": "${env:LOCALAPPDATA}/Programs/Python/Python311/Scripts/py-spy.exe", // correct path for your system
            "args": [
                // py-spy arguments
                "record",
                "--output", "${workspaceFolder}/profile.json",
                "--format", "speedscope",
                // profiled app arguments (isort)
                "--",
                "${workspaceFolder}/.venv/Scripts/python.exe", // venv for profiled app (setup needed)
                "${workspaceFolder}/isort",
                "--diff",
                "--check",
                "--verbose",
                "C:/Projects/django/django", // running isort on django repo to collect profile samples
            ],
            "problemMatcher": []
        },
    ]
}

Now you can run this task and open the profile in VS Code speedscope view with ability to jump to the source code of the profiled functions.

vscode-speedscope's People

Contributors

evg656e avatar

Stargazers

 avatar

Watchers

 avatar  avatar

vscode-speedscope's Issues

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.