The difference was more than I thought (600x times slower with time passes).
The major perfomance impact with item-bodies checking:
time: 0.003; rss: 73MB item-types checking
time: 0.317; rss: 106MB item-bodies checking
time: 0.000; rss: 106MB drop-impl checking
Case with Sync + Send:
time: 0.004; rss: 73MB item-types checking
time: 196.509; rss: 106MB item-bodies checking
time: 0.000; rss: 106MB drop-impl checking
There is no difference where I place the specification (in where clause or in the impl type parameters). Seemingly it depends on trait implementors. When I use something like:
pub trait DivertTrait: Sync + Send {}
impl<F> Worker for F where F: FnMut(&mut ContextMap) -> WorkerResult, F: DivertTrait {
fn next(&mut self, context: &mut ContextMap) -> WorkerResult {
self(context)
}
}
that code compiles during the normal time. But the following code also compiles slowly:
trait NeverImplementedTrait {}
impl<T: NeverImplementedTrait + Sync + Send> Worker for T {
fn next(&mut self, _context: &mut ContextMap) -> WorkerResult {
Ok(None)
}
}
It looks that compiler tries to find every implementor for every item of said triple, but uses agressive algorithm to detect them (why it tries to find everything if I have NeverImplementedTrait?).
Is this behaviour by design or possible to be fixed?
P.S. Iāve warm up GDB already 