functional prototype
update docs and structs, add actual logic, now it actually works
This commit is contained in:
parent
acf4c9e84d
commit
df0cf3b93d
10 changed files with 322 additions and 24 deletions
3
docs/behind-the-scenes/commands.md
Normal file
3
docs/behind-the-scenes/commands.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# How commands are run
|
||||
|
||||
I was unable to find a way to directly run *multiple* commands via Docker/Podman. Instead of doing that, greg puts all the commands in a temporary script, mounts it inside, and then run it with
|
38
docs/behind-the-scenes/default-max-threads.md
Normal file
38
docs/behind-the-scenes/default-max-threads.md
Normal file
|
@ -0,0 +1,38 @@
|
|||
# Default `max-threads`
|
||||
|
||||
The default `max-threads` uses a simple algorithm to get how many threads.
|
||||
|
||||
```rs
|
||||
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;
|
||||
}
|
||||
```
|
||||
|
||||
i.e. with `total_threads` as the number of threads the CPU(s) has:
|
||||
|
||||
- If the CPU has 32 or more threads, it will use all but 4 threads
|
||||
- If the CPU has 12 or more threads, it will use all but 2 threads
|
||||
- If the CPU has 3 or more threads, it will use all but 1 thread
|
||||
- Otherwise, i.e. if the CPU has 1 to 2 threads, it will use all threads
|
||||
|
||||
---
|
||||
|
||||
Alternative algorithms I tried:
|
||||
|
||||
```rs
|
||||
if total_threads >= 32 {
|
||||
return total_threads - total_threads.div_ceil(10);
|
||||
} else if total_threads >= 12 {
|
||||
return total_threads - 2;
|
||||
} else if total_threads >= 3 {
|
||||
return total_threads - 1;
|
||||
} else {
|
||||
return total_threads;
|
||||
}
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue