Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: check for divisibility by small primes #2

Merged

Commits on Apr 29, 2022

  1. perf: check for divisibility by small primes

    In my tests, this results in the prime searching process running approximately twice as fast. I believe this happens because:
    
    1. A very large proportion of the candidates can be eliminated by checking them for divisibility with the first 2,000 primes.
    2. Checking against the first 2,000 primes is very fast, even when single threaded in JavaScript.
    3. Calling out to OpenSSL via the terminal adds considerable overhead/latency
    ForbesLindesay committed Apr 29, 2022
    Configuration menu
    Copy the full SHA
    a1ea777 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0f5276e View commit details
    Browse the repository at this point in the history