{"id":26600852,"url":"https://github.com/unicodex/pcpc","last_synced_at":"2026-04-27T12:31:19.753Z","repository":{"id":201785118,"uuid":"175471377","full_name":"UNIcodeX/PCPC","owner":"UNIcodeX","description":"Python CFFI Performance Comparison","archived":false,"fork":false,"pushed_at":"2019-10-23T20:53:40.000Z","size":1802,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-10-20T02:09:05.638Z","etag":null,"topics":["cffi","comparison","native","nim","nim-lang","nim-language","nuitka","performance","performance-analysis","performance-metrics","performance-testing","python","python-lib","python-library","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","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/UNIcodeX.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}},"created_at":"2019-03-13T17:49:22.000Z","updated_at":"2023-10-20T04:36:49.563Z","dependencies_parsed_at":"2024-04-27T03:15:17.019Z","dependency_job_id":null,"html_url":"https://github.com/UNIcodeX/PCPC","commit_stats":null,"previous_names":["unicodex/pcpc"],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UNIcodeX%2FPCPC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UNIcodeX%2FPCPC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UNIcodeX%2FPCPC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UNIcodeX%2FPCPC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UNIcodeX","download_url":"https://codeload.github.com/UNIcodeX/PCPC/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245152181,"owners_count":20569389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cffi","comparison","native","nim","nim-lang","nim-language","nuitka","performance","performance-analysis","performance-metrics","performance-testing","python","python-lib","python-library","python3"],"created_at":"2025-03-23T18:35:42.261Z","updated_at":"2026-04-27T12:31:19.704Z","avatar_url":"https://github.com/UNIcodeX.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PCPC (Python CFFI Performance Comparison)\n\nThe purpose of this repo is to compare different options for creating Python modules and their efficiency, relative to each-other.\n\n![](https://img.shields.io/github/languages/top/UNIcodeX/PCPC?style=for-the-badge)\n![](https://img.shields.io/github/languages/count/UNIcodeX/PCPC?logoColor=green\u0026style=for-the-badge)\n![](https://img.shields.io/github/stars/UNIcodeX/PCPC?style=for-the-badge \"Star PCPC on GitHub!\")\n![](https://img.shields.io/maintenance/yes/2019?style=for-the-badge \"2019\")\n![](https://img.shields.io/github/languages/code-size/UNIcodeX/PCPC?style=for-the-badge)\n![](https://img.shields.io/github/issues-raw/UNIcodeX/PCPC?style=for-the-badge \"Bugs\")\n![](https://img.shields.io/github/issues-pr-raw/UNIcodeX/PCPC?style=for-the-badge \"PRs\")\n![](https://img.shields.io/github/last-commit/UNIcodeX/PCPC?style=for-the-badge \"Commits\")\n\n# TODOs\n- *Add more benchmarks*\n\n# How Libraries Were Built\n- **Nuitka** -- `nuitka3 --lto --module /path/to/lib.py`\n- **Cython** -- `cythonize -a -i /path/to/lib.pyx`\n- **Nim** -- `nim c --app:lib -d:release --gc:markAndSweep --out:lib.[so|pyd] /path/to/lib.nim`\n- **V** -- `v -shared -prod /path/to/lib.v`\n\n# Current Benchmark Output\n```console\n$ ./benchmark_all.sh \n\nRunning benchmark 'base64'\n---------------------------------------------------------\nPython : 0.1405s                                    1.00x\nNuitka : 0.1410s                                    1.00x\nCython : 0.1441s                                    0.97x\nNim    : 0.0845s                                    1.66x\n\nRunning benchmark 'fibonacci_iterative' to 100000 places.\n---------------------------------------------------------\nPython : 1.1194s                                    1.00x\nNuitka : 1.1471s                                    0.98x\nCython : 0.0007s                                1,559.35x\nNumba  : 0.0004s                                2,980.38x\nNim    : 0.0007s                                1,499.98x\nV      : 0.0029s                                  383.67x\n\nRunning benchmark 'fibonacci_recursive' to 30 places.\n---------------------------------------------------------\nPython : 1.6359s                                    1.00x\nNuitka : 1.0064s                                    1.63x\nCython : 0.3227s                                    5.07x\nNumba  : 0.0582s                                   28.13x\nNim    : 0.0182s                                   89.79x\nV      : 0.0585s                                   27.97x\n\nRunning benchmark 'json_loads'.\n_NOTE:_ JSON parsing within Nim is quite fast. I believe\nthere is extra overhead from converting each value to a\nstring. There is probably also more efficient way to do \npass this data back to Python. Suggestions welcome.\n---------------------------------------------------------\nPython : 0.1633s                                    1.00x\nNuitka : 0.1583s                                    1.03x\nCython : 0.1573s                                    1.04x\nNumba  : 0.5923s                                    0.28x\nNim    : 0.5128s                                    0.32x\n\nRunning benchmark 'gen_range'.\n---------------------------------------------------------\nPython : 0.4937s                                    1.00x\nNuitka : 0.4567s                                    1.08x\nCython : 0.1428s                                    3.46x\nNumba  : 0.3121s                                    1.58x\nNim    : 0.3362s                                    1.47x\n```\n\nBenchmarks were ran in a VM with the following specs.\n```\n OS: Antergos \n Kernel: x86_64 Linux \n Packages: 908\n Shell: zsh 5.7.1\n CPU: Intel Core i7-6700 \n GPU: vboxdrmfb\n RAM: 1115MiB / 3000MiB\n```\n\n# Suggestions\nSuggestions for more benchmarks are welcome, as well as PRs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funicodex%2Fpcpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funicodex%2Fpcpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funicodex%2Fpcpc/lists"}