p99 0.1.0
dotnet add package p99 --version 0.1.0
NuGet\Install-Package p99 -Version 0.1.0
<PackageReference Include="p99" Version="0.1.0" />
<PackageVersion Include="p99" Version="0.1.0" />
<PackageReference Include="p99" />
paket add p99 --version 0.1.0
#r "nuget: p99, 0.1.0"
#:package p99@0.1.0
#addin nuget:?package=p99&version=0.1.0
#tool nuget:?package=p99&version=0.1.0
p99.NET
Low-cost generation of performance percentiles (p50, p90, p99, p99.9, etc.) for cross-platform .NET workloads.
Table of Contents
- Introduction
- Installation
- Quick start
- Platform support
- Design notes
- Repository layout
- Building from source
- Benchmarks
- Packaging and distribution
- Project information
Introduction
p99 is a lightweight, low-overhead library designed for generating real-time performance percentiles in high-frequency or latency-sensitive environments.
p99.NET is the .NET implementation. Companion implementations are available as p99 (C) and p99.Rust (Rust).
Installation
dotnet add package p99
Quick start
using P99;
Histogram histogram = default;
histogram.PushEventTimeNs(120);
histogram.PushEventTimeNs(450);
histogram.PushEventTimeNs(980);
Console.WriteLine($"p50: {histogram.ValueAtP50()} ns");
Console.WriteLine($"p99: {histogram.ValueAtP99()} ns");
See samples/P99.QuickStart for a runnable example.
Platform support
The library multi-targets:
| Target | Rationale |
|---|---|
net8.0 |
Modern .NET on desktop, server, cloud, mobile (MAUI), and IoT |
netstandard2.0 |
Broad compatibility with .NET Framework 4.6.1+, Xamarin, Unity, and constrained runtimes |
NuGet selects the best-matching assembly for each consumer automatically.
Design notes
Histogram is declared unsafe in C# only to embed its 64 bucket
counts in a single contiguous block (fixed ulong _buckets[64]). That
matches the C and Rust layouts: no heap allocation for buckets, predictable
size, and cache-friendly access. It is not used due to any use of raw
pointers, unchecked memory, or any behaviour that callers need to treat as
dangerous — the public API is fully safe.
The project sets AllowUnsafeBlocks solely for this layout; consumers do not
need to enable unsafe code in their own projects.
Repository layout
p99.NET/
├── src/P99/ # Main library (NuGet package: p99)
├── tests/P99.Tests/ # Unit tests (xUnit)
├── benchmarks/ # Performance benchmarks (BenchmarkDotNet)
├── samples/ # Consumer examples
├── .github/workflows/ # CI and release automation
├── Directory.Build.props # Shared build and Source Link settings
├── Directory.Packages.props
├── global.json # Pinned SDK version
├── build.sh / build.ps1 # Local build, test, and pack scripts
└── p99.NET.sln
Building from source
Requires the .NET SDK version specified in global.json.
git clone https://github.com/synesissoftware/p99.NET.git
cd p99.NET
dotnet restore
dotnet build
dotnet test
Pack locally
dotnet pack src/P99/P99.csproj --configuration Release --output artifacts/packages
Or:
./build.sh
Benchmarks
Performance benchmarks use BenchmarkDotNet, mirroring the p99.Rust criterion suite:
dotnet run --project benchmarks/P99.Benchmarks --configuration Release -- --filter '*'
Run a subset:
dotnet run --project benchmarks/P99.Benchmarks -c Release -- --filter '*PushEventTimeNs*'
Use --job short for a quicker local run:
dotnet run --project benchmarks/P99.Benchmarks -c Release -- --job short --filter '*'
Packaging and distribution
This project is designed for adoption as a NuGet package:
- SDK-style project with
dotnet packoutput; - Package metadata (
PackageId, license expression, readme, tags); - Symbol packages (
.snupkg) for debugging; - Source Link for stepping into source from consuming projects;
- CI builds on Windows, Linux, and macOS;
- Release workflow publishes to NuGet.org on GitHub Release;
Project information
Where to get help
Contribution guidelines
See CONTRIBUTING.md. Defect reports, feature requests, and pull requests are welcome.
Related projects
- p99 — C implementation;
- p99.Python — Python implementation;
- p99.Rust — Rust implementation;
License
This project is licensed under the 3-clause BSD license. See LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 106 | 7/7/2026 |