pub enum OptWork {
Same,
Less,
}Expand description
What an optimization does to the WORK a program performs, as opposed to how fast it performs it.
Benchmarks compare languages running the same algorithm. An optimization that replaces the algorithm makes the
comparison a different one — a fair demonstration of the compiler, and one a reader must be told about: every
benchmark a OptWork::Less optimization fires on carries a note saying what the compiler did
(benchmarks/lib/benchmarks.tsv, locked by benchmark_collapse_lock), and is left out of the same-algorithm
geometric mean. Every registry row must say which it is, so a new pass cannot change a result unannounced.
Variants§
Same
The same algorithm in cheaper machine code: the program’s loops, recursion and data structures all still run.
Less
A different, cheaper algorithm when it fires: memoized recursion, a loop or recursion replaced by its closed form, a symmetric search cut in half, a map replaced by an array its keys index, a loop replaced by one instruction, work moved to compile time.
Trait Implementations§
impl Copy for OptWork
impl Eq for OptWork
impl StructuralPartialEq for OptWork
Auto Trait Implementations§
impl Freeze for OptWork
impl RefUnwindSafe for OptWork
impl Send for OptWork
impl Sync for OptWork
impl Unpin for OptWork
impl UnsafeUnpin for OptWork
impl UnwindSafe for OptWork
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.