{"id":24092750,"url":"https://github.com/liarprincess/swift-bigint-performance-tests","last_synced_at":"2025-10-06T11:28:20.819Z","repository":{"id":133389603,"uuid":"597114976","full_name":"LiarPrincess/Swift-BigInt-performance-tests","owner":"LiarPrincess","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-21T08:24:17.000Z","size":261,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-27T09:59:11.119Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LiarPrincess.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}},"created_at":"2023-02-03T16:59:30.000Z","updated_at":"2023-02-03T17:01:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"507fbbe3-0f6e-40e9-96cb-090582365beb","html_url":"https://github.com/LiarPrincess/Swift-BigInt-performance-tests","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LiarPrincess/Swift-BigInt-performance-tests","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiarPrincess%2FSwift-BigInt-performance-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiarPrincess%2FSwift-BigInt-performance-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiarPrincess%2FSwift-BigInt-performance-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiarPrincess%2FSwift-BigInt-performance-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LiarPrincess","download_url":"https://codeload.github.com/LiarPrincess/Swift-BigInt-performance-tests/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiarPrincess%2FSwift-BigInt-performance-tests/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267320257,"owners_count":24068527,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"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":"2025-01-10T08:37:31.271Z","updated_at":"2025-10-06T11:28:20.752Z","avatar_url":"https://github.com/LiarPrincess.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swift `BigInt` performance tests\n\nThis project runs performance tests for `BigInt` implementations from:\n- `swift_numerics` - [this branch](https://github.com/LiarPrincess/swift-numerics/tree/13-Performance)\n- `Violet` - [this branch](https://github.com/LiarPrincess/Violet/tree/swift-numerics) which is a `main` branch with all `swift_numerics` tests from all PRs\n  - optimized for `Int32` range. In this tests only `0`, `-1` and `1` fall into this range, so it should not matter.\n- `Violet XsProMax` - [this branch](https://github.com/LiarPrincess/Violet-BigInt-XsProMax). Violet implementation with following changes:\n  - no small inlined integer - magnitude is always stored on the heap\n  - no restrictions on the size - `isNegative` is stored in-line (and not on the heap like in Violet); `count` and `capacity` are on the heap because I don't want to stray too much from `Violet`.\n- `attaswift` - [this branch](https://github.com/LiarPrincess/BigInt/tree/Performance-tests) which is a `main` branch with added performance tests\n\n## Content\n\n- `__main__.py` - main script to run tests; most of the time you will use this\n- `multiple_run.py` - run tests multiple times in a loop; useful to combat random relative standard deviation spikes\n- `multiple_group_by_test.py` - process results from `multiple_run.py`, so that they are grouped by test (instead of per run)\n\n## How to read the results\n\nValues in parens mean relative performance improvement vs the 1st implementation. For example:\n\n|                         | 🐧 swift_numerics | 🐧 Violet                                                  | 🐧 attaswift                                              |\n| ----------------------- | ---------------- | --------------------------------------------------------- | -------------------------------------------------------- |\n| test_string_fromRadix10 | 0.2386572415     | \u003cspan style=\"color:#39a275\"\u003e0.011443098625 (20.9x)\u003c/span\u003e | \u003cspan style=\"color:#39a275\"\u003e0.025662900375 (9.3x)\u003c/span\u003e |\n\nMeans that `Violet` is 20.9 times faster than `swift_numerics` and `attaswift` is 9.3 times faster.\n\nIf you want you can also set `SHOW_RELATIVE_STANDARD_DEVIATION = True` inside the script.\n\n## How to run\n\n1. Clone all of the implementations mentioned above\n2. Open `__main__.py` and modify:\n\n    ```py\n    # Path to: https://github.com/LiarPrincess/swift-numerics/tree/13-Performance\n    # Branch: 13-Performance\n    SWIFT_NUMERICS_PATH = '…'\n    # Path to: https://github.com/LiarPrincess/Violet/tree/swift-numerics\n    # Branch: swift-numerics\n    VIOLET_PATH = '…'\n    # Path to: https://github.com/LiarPrincess/BigInt/tree/Performance-tests\n    # Branch: Performance-tests\n    ATTASWIFT_PATH = '…'\n    ```\n\n3. Select which implementations to run:\n\n    ```py\n    # 1st entry is a reference implementation,\n    # all of the others will be compared with it.\n    IMPLEMENTATIONS = (\n        SWIFT_NUMERICS,\n        VIOLET,\n        ATTASWIFT,\n    )\n    ```\n\n4. Run `python3 .` in main dir (or F5 in VSCode)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliarprincess%2Fswift-bigint-performance-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliarprincess%2Fswift-bigint-performance-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliarprincess%2Fswift-bigint-performance-tests/lists"}