zombie_profiler

Crates.iozombie_profiler
lib.rszombie_profiler
version0.0.4
created_at2025-12-22 08:58:05.970468+00
updated_at2025-12-24 18:15:25.787725+00
descriptionZero-overhead profiling utilities for Zombie benchmarks
homepage
repositoryhttps://github.com/kawayww/zombie-rs
max_upload_size
id1999360
size31,048
K.Y. (KawaYww)

documentation

README

zombie_profiler

Zero-overhead profiling utilities for zombie-rs benchmarks.

Overview

This crate provides:

  • TrackingAllocator: A global allocator that tracks memory usage
  • Profiler: Utilities for measuring time and memory in benchmarks
  • BenchmarkSuite: Framework for running comparative benchmarks

Usage

use zombie_profiler::{Profiler, TrackingAllocator, BenchmarkSuite};

#[global_allocator]
static GLOBAL: TrackingAllocator = TrackingAllocator::new();

[!WARNING] TrackingAllocator is a #[global_allocator]. Do not use it if your application already uses a custom allocator (e.g., mimalloc, jemalloc), as Rust only allows one global allocator. This crate is intended for development and benchmarking.

fn main() {
    let profiler = Profiler::new();

    // Measure a computation
    let (result, stats) = profiler.measure(|| {
        // expensive computation
        42
    });

    println!("Result: {}, Time: {:?}, Memory: {} bytes",
             result, stats.duration, stats.peak_memory);
}

Features

  • std (default): Standard library support
  • ui: Pretty-printed tables for benchmark results

License

MIT

Commit count: 0

cargo fmt