Compare commits
No commits in common. "1c0a87e9d8e243e9ab3812cfed02dcea037b2750" and "66424f704d41832c92a592655a948d1914264c56" have entirely different histories.
1c0a87e9d8
...
66424f704d
3 changed files with 36 additions and 16 deletions
|
@ -11,11 +11,10 @@ Go look at [`docs/`](/docs/)
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
- Add multithreading
|
- Add multithreading
|
||||||
|
- Add better/custom grouping for when to run jobs (dependency system? (automatic detection?))
|
||||||
- Add hook system
|
- Add hook system
|
||||||
- Add SQL database (maybe using `sqlx`?)
|
- Add SQL database (maybe using `sqlx`?)
|
||||||
- Log stderr too
|
- Log stderr too
|
||||||
- Add dependency system
|
|
||||||
- Automatic detection with features (extensibility?) for each distro?
|
|
||||||
|
|
||||||
## Other stuff
|
## Other stuff
|
||||||
|
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: 'docker.io/library/postgres:17-alpine'
|
|
||||||
environment:
|
|
||||||
- POSTGRES_PASSWORD=ReplaceMeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
|
|
||||||
# if there's already a he/him gregory down the hall, then change it to `gregory_it_its`, to make sure you know it's gregory, the program, not gregory the he/him down the hall
|
|
||||||
# ig if there's an it/its gregory already then they just have to change their name to Its Majesty Queen Henry the Eighth
|
|
||||||
# oops sorry it/its gregory down the hall, correction: it just has to changes its name
|
|
||||||
- POSTGRES_USER=gregory
|
|
||||||
- POSTGRES_DB=gregory
|
|
||||||
volumes:
|
|
||||||
- './data:/var/lib/postgresql/data'
|
|
||||||
ports:
|
|
||||||
- 9001:5432
|
|
35
src/benchmark.rs
Normal file
35
src/benchmark.rs
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
use std::time::Instant;
|
||||||
|
|
||||||
|
fn log_thing(total_threads: u32) -> u32 {
|
||||||
|
return total_threads - (f64::log(total_threads.into(), 5.0).round() as u32);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn my_thing(total_threads: u32) -> u32 {
|
||||||
|
if total_threads >= 32 {
|
||||||
|
return total_threads - 4;
|
||||||
|
} else if total_threads >= 12 {
|
||||||
|
return total_threads - 2;
|
||||||
|
} else if total_threads >= 3 {
|
||||||
|
return total_threads - 1;
|
||||||
|
} else {
|
||||||
|
return total_threads;
|
||||||
|
}
|
||||||
|
|
||||||
|
//println!("{}", max_threads)
|
||||||
|
}
|
||||||
|
|
||||||
|
// let mut total_threads = thread::available_parallelism().unwrap().get() as u32;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
/*
|
||||||
|
let now = Instant::now();
|
||||||
|
for _ in 0..100000000 {
|
||||||
|
|
||||||
|
}
|
||||||
|
let elapsed = now.elapsed();
|
||||||
|
*/
|
||||||
|
let total_threads: u32 = 128;
|
||||||
|
println!("{}", log_thing(total_threads));
|
||||||
|
println!("{}", my_thing(total_threads));
|
||||||
|
//println!("{}", elapsed.as_nanos());
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue