Hi James,

Thanks for the response. I have a few questions below :

>As for the exponetial slow-down, it's related to the fact that io is
asynchronous and
>handled by the scheduler task, but tasks are scheduled co-operative meaning
>a CPU-intensive task can block other tasks in the same thread.

But why is it the case that calling "first" twice results in the twice the
execution time as compared to calling "first" once, whereas calling
"second" twice results in much more than doubling of execution time as
compared to a call of "second" once. I did realise that "second" would be
slower as no inlining would be performed, but what was more important to me
was the way the program scales with function calls.

In particular what is it about calling a nested function (as compared to
calling a non-nested function) that results in the io behaving in an
unexpected way?

>I haven't yet figured out
>the specific reasons, but wrapping each call to `second` in it's own task
causes the time
>to drop from ~1 minute to 7 seconds. If you account for parallelism from
running in
>multiple threads, then `time` reports ~15 seconds. Which is double.

How can I wrap each "second" call in its own task? Thanks

On Tue, Apr 16, 2013 at 2:37 AM, James Miller <[email protected]> wrote:

> As for the exponetial slow-down, it's related to the fact that io is
> asynchronous and
> handled by the scheduler task, but tasks are scheduled co-operative meaning
> a CPU-intensive task can block other tasks in the same thread. I haven't
> yet figured out
> the specific reasons, but wrapping each call to `second` in it's own task
> causes the time
> to drop from ~1 minute to 7 seconds. If you account for parallelism from
> running in
> multiple threads, then `time` reports ~15 seconds. Which is double.
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev
>
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to