poopie
poopie

kALLEBALIK/poopie

NOASSERTION

A benchmarking library.

0 0 0 0
1
build.zig.zon  build.zig 
View on Github  
Updated: 1:18:57 PM Fri Nov 08 2024 Size: 305KB Created: 12:25:38 AM Sat Sep 21 2024
Dependencies:
No known dependencies
zig  fetch  --save  git+https://github.com/kALLEBALIK/poopie

Performance Optimizer Observation Platform Inside Executable

Usage

    var poopie: Poopie = .{
        .config = .{
            .store_result = true,
            .compare_mode = .slowest,
        },
    };

    var sampler = try poopie.createSampler(allocator, .{ .warmups = 100, .samples = 1000 });
    defer sampler.deinit();

    sampler.start();
    while (sampler.sample()) : (sampler.store()) {
        //
        // Some code to test
        //
    }
    _ = try poopie.collect(allocator, &sampler, .{ .name = "MyBench" });

You can overwrite poopie settings in each collection if you want

_ = try poopie.collect(allocator, &sampler, .{ .name = "MyBench", .compare_mode = .fastest });

or compare against a specific file

_ = try poopie.collect(allocator, &sampler, .{
    .name = "MyBench",
    .compare_mode = .file,
    .compare_file = "MyBench_10_100070223.1_1726867407409043.json",
});

Stores benchmarks in .benchmark folder if store_result == true (false by default).

Prev work

This shitty library is just crappy code slapped on top of Andrew's (and contributors) awesome poop code.