Skip to content

n_primes could be improved #1021

@fredrik-johansson

Description

@fredrik-johansson

The sieving code here is pretty basic. It should use some more tricks: work with a bit array mod 30 (30 integers per byte), use wheel factorization and do cache-friendly segmentation.

If iterating with n_primes_t was just a bit faster, we could probably get rid of the ugly and memory-wasteful kludge of n_primes_arr_readonly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions