Closed
Description
This program is 10x slower than the equivalent in Go:
extern crate green;
use std::task::TaskBuilder;
use green::{SchedPool, PoolConfig, GreenTaskBuilder};
use native::NativeTaskBuilder;
fn main() {
let mut pool = SchedPool::new(PoolConfig::new());
for _ in range(0u, 100000) {
let future = TaskBuilder::new().green(&mut pool).stack_size(65536).try_future(proc() {});
drop(future.unwrap());
}
pool.shutdown();
}
Profiling indicates lots of stack allocation. Interestingly enough, bumping up RUST_MAX_CACHED_STACKS
makes things much slower. So I believe stacks are never getting cached. Perhaps the stack isn't being returned by the time the future is unwrapped?