{"id":21515202,"url":"https://github.com/1git2clone/prime-nums-test","last_synced_at":"2025-03-17T16:16:03.365Z","repository":{"id":241862770,"uuid":"808100633","full_name":"1Git2Clone/prime-nums-test","owner":"1Git2Clone","description":"This repository was made to test the speed of C++'s constexpr values (at runtime) in comparison to the traditional Sieve of Eratosthenes optimization. NOTE: The SIMD solution doesn't work.","archived":false,"fork":false,"pushed_at":"2024-05-30T11:40:05.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T02:33:06.513Z","etag":null,"topics":["compile-time-meta-programming","cpp","optimization"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1Git2Clone.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-05-30T11:39:44.000Z","updated_at":"2024-05-30T11:40:37.000Z","dependencies_parsed_at":"2024-05-30T11:56:07.433Z","dependency_job_id":null,"html_url":"https://github.com/1Git2Clone/prime-nums-test","commit_stats":null,"previous_names":["1git2clone/prime-nums-test"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1Git2Clone%2Fprime-nums-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1Git2Clone%2Fprime-nums-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1Git2Clone%2Fprime-nums-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1Git2Clone%2Fprime-nums-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1Git2Clone","download_url":"https://codeload.github.com/1Git2Clone/prime-nums-test/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244066192,"owners_count":20392407,"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":["compile-time-meta-programming","cpp","optimization"],"created_at":"2024-11-23T23:54:32.204Z","updated_at":"2025-03-17T16:16:03.345Z","avatar_url":"https://github.com/1Git2Clone.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prime-nums-test\n\n### IMPORTANT NOTE\n\n**The SIMD solution (-se) doesn't actually work.**\n\n### Setting up\n\nMinimal compiling options (for g++ on the **ROOT** directory of the **REPOSITORY**):\n- -ftemplate-depth=PRIME_UPPER_LIMIT+1 -\u003e this needs to be the minimum value.\n\n```\ng++ src/main.cpp -o bin/test -march=native -mavx -ftemplate-depth=1001 -Ofast\n```\n\nThe **-Ofast** flag for g++ is optional.\n\n```\ng++ src/main.cpp -o bin/test -march=native -mavx -ftemplate-depth=1001\n```\n\n\nNo **-Ofast** variant.\n\n\nRunning variations:\n- **-eval** (-e) flag runs the barebones unoptimized solution.\n- **-sieve-of-eratosthenes** (-soe) flag runs a more optimized version using modulo math. ([wikipedia.org](https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes))\n- **-simd-eval** (-se) flag runs the same -soe flag but with AVX2 (**NOT WORKING FOR NOW!**).\n- **-constexpr-eval** (-ce) flag is the reason why your compile times are slow. It runs on compile time instead of runtime. On runtime it just gets printed.\n\n### Additional details\n\nThis project was just made as a test related to [this YouTube video](https://www.youtube.com/watch?v=8-VZoXn8f9U)\n\nThe **constexpr** data type is really interesting and I never used it before.\nBasically its used for evaluations on compile time, saving runtime resources for specific predefined data.\nThis is useful but I do wonder which exact use cases are the best for it...\nAggressive GCC optimize flags tend to do the job just fine and usually you'd be looking at data caching evaluations for the flexibility of your app.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1git2clone%2Fprime-nums-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1git2clone%2Fprime-nums-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1git2clone%2Fprime-nums-test/lists"}