{"id":48568342,"url":"https://github.com/csp-community/csp-benchmarks","last_synced_at":"2026-04-08T13:33:03.604Z","repository":{"id":325880651,"uuid":"1094483484","full_name":"csp-community/csp-benchmarks","owner":"csp-community","description":"Benchmarks for csp","archived":false,"fork":false,"pushed_at":"2026-03-09T03:40:31.000Z","size":661,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-09T08:49:59.602Z","etag":null,"topics":["asv","benchmark","benchmarks","csp","python","stream-processing","streaming"],"latest_commit_sha":null,"homepage":"https://csp-community.github.io/csp-benchmarks/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csp-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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":"2025-11-11T19:10:30.000Z","updated_at":"2026-03-09T03:40:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/csp-community/csp-benchmarks","commit_stats":null,"previous_names":["csp-community/csp-benchmarks"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/csp-community/csp-benchmarks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csp-community%2Fcsp-benchmarks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csp-community%2Fcsp-benchmarks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csp-community%2Fcsp-benchmarks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csp-community%2Fcsp-benchmarks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csp-community","download_url":"https://codeload.github.com/csp-community/csp-benchmarks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csp-community%2Fcsp-benchmarks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31558383,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T10:21:54.569Z","status":"ssl_error","status_checked_at":"2026-04-08T10:21:38.171Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["asv","benchmark","benchmarks","csp","python","stream-processing","streaming"],"created_at":"2026-04-08T13:33:03.210Z","updated_at":"2026-04-08T13:33:03.502Z","avatar_url":"https://github.com/csp-community.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# csp-benchmarks\n\nPerformance benchmarks for [csp](https://github.com/Point72/csp) using [airspeed velocity (ASV)](https://asv.readthedocs.io/).\n\n[![Build Status](https://github.com/csp-community/csp-benchmarks/actions/workflows/build.yaml/badge.svg?branch=main\u0026event=push)](https://github.com/csp-community/csp-benchmarks/actions/workflows/build.yaml)\n[![Benchmarks](https://github.com/csp-community/csp-benchmarks/actions/workflows/benchmarks.yaml/badge.svg)](https://github.com/csp-community/csp-benchmarks/actions/workflows/benchmarks.yaml)\n[![License](https://img.shields.io/github/license/csp-community/csp-benchmarks)](https://github.com/csp-community/csp-benchmarks)\n\n## Overview\n\nThis repository contains performance benchmarks for the csp library, designed to:\n\n- Track performance over time across commits\n- Detect performance regressions\n- Compare different implementations and configurations\n- Run on dedicated Hetzner Cloud machines for consistent results\n\n## Benchmark Suites\n\n### Core Benchmarks (bench_core.py)\n\n- **GraphExecutionSuite**: Tests graph execution with varying node counts and tick rates\n- **NodeOverheadSuite**: Measures node invocation overhead\n\n### Stats Benchmarks (bench_stats.py)\n\n- **StatsBenchmarkSuite**: Tests statistical functions (median, quantile, rank)\n- **StatsScalingSuite**: Tests how stats scale with data size\n\n### Baselib Benchmarks (bench_baselib.py)\n\n- **BaselibSuite**: Tests built-in operations (filter, sample, delay, merge, flatten)\n- **CurveSuite**: Tests historical data loading\n\n### Math Benchmarks (bench_math.py)\n\n- **MathSuite**: Tests arithmetic and comparison operations\n- **AccumulatorSuite**: Tests accumulating operations (accum, count, diff)\n\n## Quick Start\n\n### Installation\n\n```bash\n# Install with development dependencies\npip install -e \".[develop]\"\n\n# For Hetzner Cloud integration\npip install -e \".[develop,hetzner]\"\n```\n\n### Running Benchmarks with the CLI\n\nAfter installing `csp-benchmarks`, you can run benchmarks locally against your installed csp version:\n\n```bash\n# List all available benchmark suites\ncsp-benchmarks list\n\n# Run all benchmarks\ncsp-benchmarks run\n\n# Run specific suite (core, baselib, math, stats)\ncsp-benchmarks run --suite core\n\n# Run specific benchmark method\ncsp-benchmarks run --method linear_graph\n\n# Quick mode (fewer parameter combinations)\ncsp-benchmarks run --quick\n\n# Verbose output with min/max timing\ncsp-benchmarks run --suite baselib --verbose\n\n# Custom number of runs per benchmark\ncsp-benchmarks run --runs 5\n```\n\nCLI Options:\n\n- `--suite, -s`: Filter to specific suite (e.g., 'core', 'baselib')\n- `--method, -m`: Filter to specific method name pattern\n- `--quick, -q`: Quick mode with fewer parameter combinations\n- `--runs, -r`: Number of runs per benchmark (default: 3)\n- `--verbose, -v`: Show detailed timing info (min/max)\n\n### Running Benchmarks with Make\n\n```bash\n# Run quick benchmarks for the current commit\nmake benchmark-quick\n\n# Run full benchmarks\nmake benchmark\n\n# Run using local Python environment (no virtualenv)\nmake benchmark-local\n\n# View results\nmake benchmark-view\n```\n\n### Using ASV Directly\n\n```bash\n# Initialize machine configuration\npython -m asv machine --yes\n\n# Run benchmarks for current commit\npython -m asv run HEAD^!\n\n# Compare with previous commit\npython -m asv compare HEAD~1 HEAD\n\n# Generate and serve HTML report\npython -m asv publish\npython -m asv preview\n```\n\n## Hetzner Cloud Integration\n\nFor consistent benchmark results, this repository supports running benchmarks on dedicated Hetzner Cloud servers.\n\n### Setup\n\n1. Create a Hetzner Cloud API token at \u003chttps://console.hetzner.cloud/\u003e\n1. Set the token as a repository secret: `HCLOUD_TOKEN`\n1. Generate an SSH key pair: `ssh-keygen -t ed25519 -f hetzner_key -N \"\"`\n1. Add the **public key** to Hetzner Cloud Console with name `benchmarks`\n1. Add the **private key** content as repository secret: `HETZNER_SSH_PRIVATE_KEY`\n\n### Running on Hetzner\n\n```bash\n# Set your Hetzner token\nexport HCLOUD_TOKEN=\"your-token-here\"\n\n# Run benchmarks on Hetzner (SSH key must already exist in Hetzner as 'benchmarks')\npython -m csp_benchmarks.hetzner.cli run --ssh-key ~/.ssh/hetzner_key --ssh-key-name benchmarks --push\n\n# Clean up any leftover servers\npython -m csp_benchmarks.hetzner.cli cleanup\n```\n\n### GitHub Actions\n\nBenchmarks run automatically:\n\n- **On push to main**: Benchmarks for the new commit\n- **Manual trigger**: Via workflow_dispatch with custom options\n\n## Results\n\nBenchmark results are stored in the `results/` directory and published to GitHub Pages.\n\nView the latest results at: \u003chttps://csp-community.github.io/csp-benchmarks/\u003e\n\n## Contributing\n\n### Adding New Benchmarks\n\n1. Add new benchmarks to the `benchmarks/` directory\n1. Follow ASV naming conventions (`bench_*.py`, class names ending in `Suite`)\n1. Use parameterized benchmarks for testing across different configurations\n1. Run `make benchmark-local` to test your benchmarks before submitting\n\n### Contributing Machine Results\n\nYou can contribute benchmark results from your own machine to help the community understand csp performance across different hardware configurations.\n\n#### Step 1: Register Your Machine\n\nAdd your machine to `csp_benchmarks/asv-machine.json`. Use a unique, descriptive name:\n\n```json\n{\n    \"timkpaine-framework-13\": {\n        \"arch\": \"x86_64\",\n        \"cpu\": \"AMD Ryzen AI 9 HX 370 (24 cores)\",\n        \"machine\": \"timkpaine-framework-13\",\n        \"num_cpu\": \"24\",\n        \"os\": \"Ubuntu 24.04\",\n        \"ram\": \"64GB\"\n    }\n}\n```\n\nMachine naming convention: `username-device-model` (e.g., `timkpaine-framework-13`, `johndoe-mbp-m3`)\n\n#### Step 2: Run Benchmarks\n\n```bash\n# Install dependencies\npip install -e \".[develop]\"\n\n# Copy machine config to ASV location\ncp csp_benchmarks/asv-machine.json ~/.asv-machine.json\n\n# Run benchmarks with your machine name\npython -m asv run --config csp_benchmarks/asv.conf.json --machine your-machine-name\n\n# Or use make (runs with local Python)\nmake benchmark-local\n```\n\n#### Step 3: Verify Results\n\n```bash\n# Check that results were created\nls csp_benchmarks/results/your-machine-name/\n\n# Preview the results locally\nmake benchmark-view\n```\n\n#### Step 4: Submit a Pull Request\n\n1. Fork the repository\n1. Create a branch: `git checkout -b add-machine-results`\n1. Commit your changes:\n   - `csp_benchmarks/asv-machine.json` (your machine entry)\n   - `csp_benchmarks/results/your-machine-name/` (your result files)\n1. Open a PR with a description of your hardware\n\n#### Tips for Consistent Results\n\n- Close other applications during benchmarking\n- Run on AC power (not battery) for laptops\n- Ensure stable CPU frequency (disable turbo boost for more consistent results)\n- Run multiple times and verify results are stable\n- Include your OS version and Python version in the PR description\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsp-community%2Fcsp-benchmarks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsp-community%2Fcsp-benchmarks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsp-community%2Fcsp-benchmarks/lists"}