fxprof-processed-profile

Build profiles in the Firefox Profiler processed JSON format from Rust.

Library
Cargo
v0.8.1
4,380stars
MIT OR Apache-2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
81/100Excellent
Development Activity96
Maintenance72
Community56
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
77/100Good
Architecture80
Code Quality82
Innovation82
Learning Curve65

fxprof-processed-profile is a Rust crate for constructing performance profiles in the Firefox Profiler’s processed profile JSON format, ready to load into profiler.firefox.com. It provides a Profile builder into which you add processes, threads, samples, stacks, frames, markers, and categories, then serialize to JSON via serde.

Part of the samply profiler project, the crate models the profiler’s data structures with handle-based APIs for strings, frames, and stacks so large profiles stay compact and efficient to assemble. It is the format-building layer used to turn sampled call-stack data into interactive flame graphs and timelines in the Firefox Profiler UI.

What You Get

  • A Profile builder for the Firefox Profiler processed JSON format
  • Handle-based APIs for strings, frames, and stacks to keep large profiles compact
  • serde-based serialization straight to JSON loadable at profiler.firefox.com

Common Use Cases

  • Exporting a custom profiler’s samples into a format the Firefox Profiler can visualize
  • Generating flame graphs and timelines from sampled call-stack data
  • Adding markers and categories to enrich a performance profile

Under The Hood

Architecture The crate exposes a Profile aggregate that owns processes, threads, and interned tables for strings, frames, and stacks. Callers add data through handle-returning methods (handle_for_string, handle_for_frame_with_label, handle_for_stack, add_sample), building a stack tree by reference rather than duplicating frames. Serialization is driven by serde derive implementations that emit the Firefox Profiler processed schema. Tech Stack Rust (edition 2021, MSRV 1.63) depending on serde, serde_derive, serde_json, bitflags, debugid, rustc-hash, and indexmap (with serde feature); assert-json-diff is used in tests. Code Quality Maintained as part of the actively-developed samply project (thousands of commits, dozens of contributors) with JSON-diff tests validating serialized output against expected fixtures. API Design The handle-based builder keeps the API allocation-conscious and hard to misuse, and the documented example shows a complete profile assembled in a few lines before serializing with serde_json.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search