EmbarkStudios/puffin
EmbarkStudios/puffin has 1,761 GitHub stars and 115 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-08 01:58 UTC. Last push 2026-10-26.
🐦 Friendly little instrumentation profiler for Rust 🦀
Measured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalHow to use
fn my_function() {
puffin::profile_function!();
...
if ... {
puffin::profile_scope!("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 50-200 ns.
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 ns on an M1 MacBook Pro (plus some stack space).
Once per frame you need to call puffin::GlobalProfiler::lock().new_frame();.

Remote profiling
You can use puffin_http to send profile events over TCP to puffin_viewer. This is as easy as:
fn main() {
let server_addr = format!("127.0.0.1:{}", puffin_http::DEFAULT_PORT);
let _puffin_server = puffin_http::Server::new(&server_addr).unwrap();
eprintln!("Run this to view profiling data: puffin_viewer {server_addr}");
puffin::set_scopes_on(true);
…
// You also need to periodically call
// `puffin::GlobalProfiler::lock().new_frame();`
// to flush the profiling events.
}
egui integration
To view the profile data in-game you can use puffin_egui.
If you are using eframe you can look at this example.
Other
Also check out the crate profiling which provides a unifying layer of abstraction on top of puffin and other profiling crates.
Contributing
We welcome community contributions to this project.
Please read our Contributor Guide for more information on how to get started.
Releasing
We use the cargo release tool to manage changelogs, git tags and publishing crates.
Each substantial pull request should add a changelog entry under the [Unreleased] section (see keep a changelog
and previous changelog entries). The crate version in Cargo.toml is never updated manually in a PR as it's handled by cargo release.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
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.
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,827 starspublic-apis/public-apis
A collective list of free APIs
497,060 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
441,410 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,155 stars