-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Break out tests and prime wheel generator to separate files. Upgrade to latest dependencies, except for clap. Improve section about memory efficiency in the README.
- Loading branch information
Showing
6 changed files
with
120 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
Cargo.lock | ||
target/ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "prime-factor" | ||
description = "A prime number factorizer written in Rust" | ||
version = "0.4.3" | ||
version = "0.4.4" | ||
authors = ["Stefan Lindblad <[email protected]>"] | ||
license = "LGPL-2.1-or-later" | ||
edition = "2021" | ||
|
@@ -23,16 +23,16 @@ path = "benches/benchmark.rs" | |
harness = false | ||
|
||
[dependencies] | ||
clap = "2.33.3" | ||
log = "0.4.13" | ||
stderrlog = "0.5.1" | ||
genawaiter = "0.99.1" | ||
rayon = "1.5.1" | ||
clap = "2.34" | ||
log = "0.4" | ||
stderrlog = "0.5" | ||
genawaiter = "0.99" | ||
rayon = "1.8" | ||
|
||
[dev-dependencies] | ||
criterion = "0.3.5" | ||
rand = { version = "0.8.3", features = ["small_rng"] } | ||
reikna = "0.12.3" | ||
criterion = "0.5" | ||
rand = { version = "0.8", features = ["small_rng"] } | ||
reikna = "0.12" | ||
|
||
[profile.release] | ||
codegen-units = 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#![deny(unsafe_code)] | ||
#![allow(dead_code)] | ||
use genawaiter::yield_; | ||
use genawaiter::stack::producer_fn; | ||
|
||
/// Wheel factorization algorithm with base {2, 3, 5} | ||
/// https://en.wikipedia.org/wiki/Wheel_factorization | ||
#[producer_fn(u128)] | ||
pub async fn prime_wheel_30() { | ||
yield_!(2); | ||
yield_!(3); | ||
yield_!(5); | ||
let mut base = 0u128; | ||
loop { | ||
for n in [7, 11, 13, 17, 19, 23, 29, 31] { | ||
yield_!(base + n); | ||
} | ||
base += 30; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters