All Projects → EmbarkStudios → Puffin

EmbarkStudios / Puffin

Licence: other
🐦 Simple instrumentation profiler for Rust 🦀

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Puffin

Yii2 Debug
Debug Extension for Yii 2
Stars: ✭ 179 (-34.67%)
Mutual labels:  hacktoberfest, profiler
Phpspy
Low-overhead sampling profiler for PHP 7+
Stars: ✭ 1,105 (+303.28%)
Mutual labels:  hacktoberfest, profiler
Vardbg
A simple Python debugger and profiler that generates animated visualizations of program flow, useful for algorithm learning.
Stars: ✭ 543 (+98.18%)
Mutual labels:  hacktoberfest, profiler
Nlp profiler
A simple NLP library allows profiling datasets with one or more text columns. When given a dataset and a column name containing text data, NLP Profiler will return either high-level insights or low-level/granular statistical information about the text in that column.
Stars: ✭ 181 (-33.94%)
Mutual labels:  hacktoberfest, profiler
Protein
💊 Protein is an IntelliJ Plugin to generate Kotlin code for Retrofit 2 and RxJava 2 based on a Swagger definition
Stars: ✭ 273 (-0.36%)
Mutual labels:  hacktoberfest
Takeoff
A rapid development environment using docker for convenience.
Stars: ✭ 271 (-1.09%)
Mutual labels:  hacktoberfest
Openms
The codebase of the OpenMS project
Stars: ✭ 270 (-1.46%)
Mutual labels:  hacktoberfest
Documentation
📘 Nextcloud documentation
Stars: ✭ 268 (-2.19%)
Mutual labels:  hacktoberfest
Nqp
NQP
Stars: ✭ 273 (-0.36%)
Mutual labels:  hacktoberfest
Tlint
Tighten linter for Laravel conventions
Stars: ✭ 274 (+0%)
Mutual labels:  hacktoberfest
Php
All Algorithms implemented in Php
Stars: ✭ 272 (-0.73%)
Mutual labels:  hacktoberfest
Laravel Gamp
📊 Laravel Google Analytics Measurement Protocol Package
Stars: ✭ 271 (-1.09%)
Mutual labels:  hacktoberfest
Awesome Go Storage
A curated list of awesome Go storage projects and libraries
Stars: ✭ 3,224 (+1076.64%)
Mutual labels:  hacktoberfest
Github Tag Action
A Github Action to tag a repo on merge.
Stars: ✭ 270 (-1.46%)
Mutual labels:  hacktoberfest
Node Sass Magic Importer
Custom node-sass importer for selector specific imports, module importing, globbing support and importing files only once.
Stars: ✭ 273 (-0.36%)
Mutual labels:  hacktoberfest
Github Stats
📈 Visualize stats about GitHub users and projects in your terminal.
Stars: ✭ 271 (-1.09%)
Mutual labels:  hacktoberfest
Fluentresults
A generalised Result object implementation for .NET/C#
Stars: ✭ 266 (-2.92%)
Mutual labels:  hacktoberfest
Travis Ci Discord Webhook
⛓ Here's your serverless solution for sending build status from Travis CI to Discord as webhooks.
Stars: ✭ 273 (-0.36%)
Mutual labels:  hacktoberfest
Cryptoexchange
[UNMAINTAINED] Ruby library to query market data from cryptocurrency exchanges (https://www.coingecko.com)
Stars: ✭ 272 (-0.73%)
Mutual labels:  hacktoberfest
Starcli
✨ Browse GitHub trending projects from your command line
Stars: ✭ 269 (-1.82%)
Mutual labels:  hacktoberfest

🐦 Puffin - The Friendly Little Profiler

Embark Embark Crates.io Docs dependency status Build Status

Puffin photo by Richard Bartz

Puffin is an instrumentation profiler written in Rust where you opt-in to profile parts of your code:

fn my_function() {
    puffin::profile_function!();
    ...
    if ... {
        puffin::profile_scope_data!("load_image", image_name);
        ...
    }
}

The Puffin macros write data to a thread-local data stream. When the outermost scope of a thread is closed, the data stream is sent to a global profiler collector. The scopes are pretty light-weight, costing around 100-200 nanoseconds.

You have to turn on the profiler before it captures any data with a call to puffin::set_scopes_on(true);. When the profiler is off the profiler scope macros only has an overhead of 1-2 ns (and some stack space);

Once per frame you need to call puffin::GlobalProfiler::lock().new_frame();.

UI

If you want to view a nice flamegraph of your profile data, you can use the crate puffin-imgui in this repo. It looks like this:

Puffin Flamegraph UI

A full example is something like this:

fn main() {
    puffin::set_scopes_on(true); // you may want to control this with a flag
    let mut puffin_ui = puffin_imgui::ProfilerUi::default();

    // game loop
    loop {
        puffin::GlobalProfiler::lock().new_frame();

        {
            puffin::profile_scope!("slow_code");
            slow_code();
        }

        puffin_ui.window(ui);
    }
}

Other

Also check out the crate profiling which provides a unifying layer of abstraction on top of puffin and other profiling crates. It also has a working example of puffin-imgui.

Contributing

Contributor Covenant

We welcome community contributions to this project.

Please read our Contributor Guide for more information on how to get started.

License

Licensed under either of

at your option.

Puffin photo by Richard Bartz

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

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].