{"id":51509507,"url":"https://github.com/murphsicles/testicles","last_synced_at":"2026-07-08T04:30:57.443Z","repository":{"id":359024895,"uuid":"1244169605","full_name":"murphsicles/testicles","owner":"murphsicles","description":"Statistics-driven microbenchmarking and test suite for Zeta.","archived":false,"fork":false,"pushed_at":"2026-05-20T03:12:02.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-20T06:45:15.732Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/murphsicles.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-20T02:58:13.000Z","updated_at":"2026-05-20T03:12:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/murphsicles/testicles","commit_stats":null,"previous_names":["murphsicles/testicles"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/murphsicles/testicles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murphsicles%2Ftesticles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murphsicles%2Ftesticles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murphsicles%2Ftesticles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murphsicles%2Ftesticles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/murphsicles","download_url":"https://codeload.github.com/murphsicles/testicles/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murphsicles%2Ftesticles/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35252324,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-08T02:00:06.796Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-08T04:30:56.517Z","updated_at":"2026-07-08T04:30:57.431Z","avatar_url":"https://github.com/murphsicles.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🥜 Testicles\n\n**Testicles** — the Zeta-native benchmark suite that packs a punch.\n\nStatistics-driven microbenchmarking with no external runtime and no useless ceremony.\n\n| Test                        | Result      |\n|-----------------------------|-------------|\n| Does it compile?            | ✅          |\n| Are the numbers real?       | ✅          |\n| Is it pure Zeta?            | ✅‍⬛           |\n| Will it stack up?           | You bet 🫡 |\n\n## 🔬 What's in the Package?\n\nTesticles gives you the tools to measure what matters:\n\n| Module          | What it does                                           |\n|-----------------|--------------------------------------------------------|\n| `timing.z`      | Nanosecond-precision walls — see how fast it really is |\n| `runner.z`      | Warm-up, iterate, sample — the workout you need        |\n| `statistics.z`  | Mean, median, std dev, percentiles — the full package  |\n| `comparison.z`  | A/B your code — because one testicle is never enough   |\n| `report::text`  | Pretty tables so everyone can admire your numbers      |\n\n## 🧪 Usage\n\n```zeta\nuse testicles;\n\nfn bench_something() {\n    let mut sum: i64 = 0;\n    let mut i: i64 = 0;\n    while i \u003c 1000 {\n        sum += i * i;\n        i += 1;\n    }\n    _ = sum;\n}\n\nfn main() {\n    testicles::bench_group(\"my first workout\", [\n        testicles::bench_function(\"square sum 1000\", bench_something),\n    ]);\n}\n```\n\n## 📊 The Nuts and Bolts\n\n### Warm-up\n\nEvery benchmark gets a warm-up phase — because nobody performs cold. 🥶\n\n```\n  bench_name ... ⏳ warming up... ✅\n```\n\n### Measurement\n\n100 samples collected per benchmark, with automatic iteration count estimation to fill the minimum measurement window (100ms default). No guesswork — just hard numbers.\n\n### Statistics\n\nWe calculate:\n\n| Stat            | What it measures                       | Emoji        |\n|-----------------|----------------------------------------|--------------|\n| Mean            | Average time per iteration             | ⚖️           |\n| Std Dev         | How consistent your code is            | 🎯           |\n| CV              | Normalized variation (ratio brain)     | 📐           |\n| Median          | The middle of the pack                 | 🎪           |\n| P95 / P99       | Tail latency — the squeaky wheels      | 🐌           |\n| Slope           | Drift over run — is it getting slower? | 📈           |\n\n## 🧪 Example Output\n\n```\ntesticles demo benchmarks\n-------------------------\n  sum 1000 squares ... ⏱\n\n  Benchmark                          Mean      Std Dev       CV     Median  Throughput\n  --------------------------------------------------------------------------------\n  sum 1000 squares               123.45 ns    12.34 ns    10.0%   120.00 ns    8.1 M/s\n  fill 1024 array                456.78 ns    45.67 ns    10.0%   450.00 ns    2.2 M/s\n  concat 100 strings              89.01 us     8.90 us    10.0%    88.00 us   11.2 K/s\n  modulo 10000                     5.67 us     0.57 us    10.0%     5.50 us  176.4 K/s\n```\n\n## 🏋️ Why \"Testicles\"?\n\nBecause real benchmarks have **balls**. 💪\n\nWe named it for what it does — it tests your code's **ticks** (timing) and gives you the **cles** (cycles). Also, it's a great conversation starter at parties:\n\n\u003e \"What's your testicles look like?\"\n\u003e \"Solid 99th percentile, two standard deviations under the mean.\"\n\n## 🚀 Quick Start\n\n```bash\n# Clone\ngit clone https://github.com/murphsicles/testicles.git\ncd testicles\n\n# Run the example\nzetac tests/example.z\n\n# Bench your own code\nzetac src/testicles.z\n```\n\n## 🔨 API Reference\n\n### `testicles::bench_function(name: string, func: fn()) -\u003e Benchmark`\n\nWraps a function into a benchmark ready for group evaluation. The `name` is what shows up in your report tables — make it descriptive, make it proud.\n\n### `testicles::bench_group(name: string, benches: []Benchmark)`\n\nRuns a full benchmark suite, prints a formatted summary. Groups are the main event — gather your benchmarks, run them together, compare like-for-like.\n\n### `runner::run_benchmark(name: string, body: fn()) -\u003e BenchResults`\n\nThe low-level entry. Returns raw sample data for custom analysis.\n\n### `runner::analyze(results: BenchResults) -\u003e Analysis`\n\nTurns raw timing data into statistically meaningful results: mean, std dev, median, percentiles, slope, and more.\n\n### `statistics::comparison(old: Analysis, new: Analysis) -\u003e Comparison`\n\nCompare two runs head-to-head. Detect statistically significant changes. Know if your \"optimization\" actually made things worse (we've all been there 🫣).\n\n## 🔄 Comparison Detection\n\nWhen you have two runs of the same benchmark:\n\n```zeta\nuse comparison;\n\nlet comparison_result = comparison::compare(\"my bench\", old_analysis, new_analysis);\n```\n\nIf the difference exceeds 3× the pooled standard error, it's flagged as significant:\n\n| Direction   | Meaning                          | Emoji     |\n|-------------|----------------------------------|-----------|\n| `improved`  | Your change actually helped      | ✅ faster |\n| `regressed` | You made it worse — congrats 🎉  | 🐢 slower |\n| `unchanged` | Noise. Try harder next time.     | ➡ same   |\n\n## 📋 License\n\nMIT — because benchmarks should be free, just like your hot takes.\n\n---\n\n*Built for the Zeta ecosystem by [murphsicles](https://github.com/murphsicles).*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmurphsicles%2Ftesticles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmurphsicles%2Ftesticles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmurphsicles%2Ftesticles/lists"}