Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Primetheus

Primetheus Banner

🧠 Primetheus – High-Performance Prime Number Sieve

Primetheus is a high-performance, memory-efficient, and multithreaded prime counting engine.
It calculates the number of primes up to 10¹² in ~188 seconds using only 13 MB RAM throughout the entire generation.

Built with pure C++, low-level memory control, and raw performance in mind. And LOVE of GOD


🚀 Features

  • ⚙️ Bitpacked Segment Sieving – Ultra-efficient memory usage
  • 🧵 Multithreaded (32 threads in my case) – Fully parallelized across CPU cores
  • 🧮 Custom Integer Square Root – No floating-point inaccuracies, therefore little less affected by already running applications
  • 🧱 Wheel-30 Filtering – Filters ~73% of composites before sieving
  • 💾 Fixed RAM footprint (~13 MB) – No heap growth during execution
  • 🔐 Licensed under SSPL – For controlled, transparent use

📊 Benchmark

Input Range Threads Time RAM Usage Prime Count Accuracy
10¹² 32 mycase ~188 sec ~13 MB 37,607,912,018 ✅ Exact

Benchmarked on an AMD Ryzen 3950X system


🛠️ Build Instructions

Visual Studio

  1. Clone the repository
    git clone https://github.com/Rick-laboratory/Primetheus.git
  2. Open Primetheus.vcxproj in Visual Studio
  3. Select Release x64
  4. Build & run

✅ No .sln required
✅ No external libraries
✅ No bullshit


🔍 Why?

Because too much modern code is bloated, abstracted, and inefficient.
Primetheus proves you can:

  • Process trillion-scale input
  • With megabyte-static memory
  • At CPUs-native speed

It's my personal engineering testament.


🤯 Philosophy

We don’t overuse memory. We don’t overuse abstractions.
We respect the system. And it repsects us.


📜 License

SSPL (Server Side Public License)
Use is permitted with conditions. Redistribution and modification require full compliance.
See LICENSE for details.


📧 Contact

Built by Rick Armbruster

For questions, licensing, or performance consulting:
📫 LinkedIn


🧠 Pro tip

Try building this on Linux using g++ with -std=c++20 -O3 -march=native -pthread
If you beat the current benchmark, let me know. 😎


🌍 What’s next?

  • SIMD acceleration (optional AVX2 build)
  • Extended output (store primes / diffs)
  • Cross-platform benchmarks
  • Binary distribution

⚠️ Disclaimer for Security Enthusiasts This tool is not designed to break RSA. It’s for mathematical analysis, benchmarking, and compression research.

If your threat model includes "counting to 10^512 to crack encryption", please consult a cryptographer or take a nap.

"Built because the world needed a smarter sieve.

License

This project is licensed under the Server Side Public License v1 (SSPL).
See the LICENSE file for details.

About

SSPL

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages