{"id":47892532,"url":"https://github.com/cipher982/py-perf-compare","last_synced_at":"2026-04-04T03:10:51.046Z","repository":{"id":267508912,"uuid":"901473332","full_name":"cipher982/py-perf-compare","owner":"cipher982","description":"Benchmarking Python performance across different compilation and interpretation methods (CPython, Cython, PyPy). Includes CPU, memory, and mixed workload tests.","archived":false,"fork":false,"pushed_at":"2024-12-31T19:47:19.000Z","size":223,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-31T20:17:00.143Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/cipher982.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-12-10T18:12:36.000Z","updated_at":"2024-12-31T19:47:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"ebab253a-fa01-43aa-905a-941532ceb0ae","html_url":"https://github.com/cipher982/py-perf-compare","commit_stats":null,"previous_names":["cipher982/py-perf-compare"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cipher982/py-perf-compare","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cipher982%2Fpy-perf-compare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cipher982%2Fpy-perf-compare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cipher982%2Fpy-perf-compare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cipher982%2Fpy-perf-compare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cipher982","download_url":"https://codeload.github.com/cipher982/py-perf-compare/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cipher982%2Fpy-perf-compare/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31386001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T01:22:39.193Z","status":"online","status_checked_at":"2026-04-04T02:00:07.569Z","response_time":60,"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-04-04T03:10:50.467Z","updated_at":"2026-04-04T03:10:51.038Z","avatar_url":"https://github.com/cipher982.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Performance Comparison\n\n## Project Goals\nA benchmarking suite that compares performance across different Python implementations (CPython, Cython, PyPy) for various computational tasks. The project uses Docker to ensure consistent testing environments and reproducible results.\n\n## Overview\nThis project provides performance comparisons across three types of computational tasks:\n- CPU-bound operations (prime number calculations)\n- Memory-bound operations (matrix multiplication)\n- Mixed operations (Fibonacci sequence with memoization)\n\n## Project Structure\n```\n.\n├── benchmarks/\n│   ├── performance_runner.py    # Performance measurement script\n│   └── results_processor.py     # Results processing and visualization\n├── src/\n│   ├── pure/                    # Pure Python implementations\n│   │   ├── cpu_test_python.py   # Pure Python CPU-bound test\n│   │   ├── cpu_test_cython.pyx  # Cython CPU-bound test\n│   │   ├── memory_test_python.py # Pure Python memory-bound test\n│   │   ├── memory_test_cython.pyx # Cython memory-bound test\n│   │   ├── mixed_test_python.py  # Pure Python mixed test\n│   │   └── mixed_test_cython.pyx # Cython mixed test\n│   └── numpy/                   # NumPy-optimized implementations\n│       ├── cpu_test_numpy.py    # NumPy CPU-bound test\n│       ├── cpu_test_cython.pyx  # Cython+NumPy CPU-bound test\n│       ├── memory_test_python.py # NumPy memory-bound test\n│       └── memory_test_cython.pyx # Cython+NumPy memory-bound test\n├── docker/\n│   ├── Dockerfile.base         # Base Docker configuration\n│   ├── Dockerfile.cpython      # CPython environment\n│   └── Dockerfile.pypy         # PyPy environment\n├── results/                    # Benchmark results\n│   ├── cpython/                # CPython test results\n│   ├── pypy/                   # PyPy test results\n│   ├── logs/                   # Benchmark run logs\n│   └── performance_comparison.png  # Visualization of results\n├── docker-compose.yml          # Docker services configuration\n├── docker-entrypoint.sh        # Container startup script\n├── pyproject.toml             # Project configuration and dependency management\n├── setup.py                   # Additional build and setup configurations\n├── uv.lock                    # Dependency lock file\n├── .pre-commit-config.yaml    # Pre-commit hooks configuration\n├── .env                       # Default benchmark parameters\n└── requirements-pypy.txt      # PyPy-specific dependencies\n```\n\n## Project Dependencies and Configuration\n- **Dependency Management**: \n  - `pyproject.toml`: Primary configuration for project dependencies\n  - `uv.lock`: Ensures consistent dependency versions across environments\n  - `setup.py`: Additional build and packaging configurations\n\n- **Code Quality**:\n  - Pre-commit hooks configured in `.pre-commit-config.yaml`\n  - Ensures code style and quality standards\n\n## Benchmark Implementations\n\n### Test Variations\nEach computational task is implemented in multiple variations:\n- Pure Python implementations\n- NumPy-optimized implementations\n- Cython-optimized implementations\n- PyPy-compatible implementations\n\n### Benchmark Types\n\n#### CPU-bound Test\nMeasures pure computational performance through prime number calculations.\n- Implementation: Sieve of Eratosthenes algorithm\n- Metrics: Raw computation speed\n- Variations:\n  - Pure Python implementation\n  - NumPy-accelerated implementation\n  - Cython-optimized implementation\n  - PyPy-compatible implementation\n\n#### Memory-bound Test\nEvaluates memory handling through matrix operations.\n- Implementation: Matrix multiplication \n- Metrics: Memory usage and operation speed\n- Variations:\n  - Pure Python implementation\n  - NumPy-accelerated implementation\n  - Cython-optimized implementation\n  - PyPy-compatible implementation\n\n#### Mixed Test\nTests both CPU and memory performance using Fibonacci sequence.\n- Implementation: Iterative Fibonacci calculation\n- Metrics: Combined CPU and memory performance\n- Variations:\n  - Pure Python implementation\n  - Cython-optimized implementation\n  - PyPy-compatible implementation\n\n## Prerequisites\n- Docker\n- Docker Compose\n- Python 3.11+\n\n## Running Benchmarks\n\n### Quick Start with Docker (Recommended)\n```bash\n# Run all implementations\nIMPLEMENTATION=all RUNS=3 PRIME_UPPER_BOUND=1000000 MATRIX_DIMENSION=200 FIBONACCI_LENGTH=500 docker compose up\n\n# Or run specific implementation\nIMPLEMENTATION=cpython RUNS=3 PRIME_UPPER_BOUND=1000000 MATRIX_DIMENSION=200 FIBONACCI_LENGTH=500 docker compose up\n```\n\n### Configuration\nDefault values for all parameters are provided in `.env`. You can override them using environment variables:\n- `IMPLEMENTATION`: Target implementation (all, cpython, cython, pypy)\n- `RUNS`: Number of test iterations\n- `PRIME_UPPER_BOUND`: Upper limit for prime number calculations\n- `MATRIX_DIMENSION`: Size of matrices (NxN) for multiplication\n- `FIBONACCI_LENGTH`: Number of Fibonacci numbers to calculate\n\nResults will be saved to:\n- `./results/cpython/` - CPython and Cython results\n- `./results/pypy/` - PyPy results\n- `./results/logs/` - Detailed benchmark logs\n\n## Results Interpretation\n- Detailed CSV results available for each test type and implementation\n- Performance comparison visualizations generated in `results/`\n- Comprehensive logging provides in-depth insights into benchmark performance\n\n## License\nSee the `LICENSE` file for details about project licensing.\n\n## Contributing\nContributions are welcome! Please refer to project guidelines and code of conduct.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcipher982%2Fpy-perf-compare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcipher982%2Fpy-perf-compare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcipher982%2Fpy-perf-compare/lists"}