async fast path

549 views Asked by At

Here is an article on how the Async CTP refresh can take advantage of the async "fast path".

It mentions things like greater efficiency etc, but I dont even know what the "fast path" is? I would like to determine whether the tips in the article are relevant to me, but could not really find an explanation of "fast path"?

2

There are 2 answers

0
Nick Butler On BEST ANSWER

The "fast path" is when the Task being awaited has already completed by the time it is awaited.

If this happens, then there is no point in await returning from your method because the next continuation will be queued immediately.

So in the "fast path", await does not yield and execution continues in your method.

0
Marc Gravell On

I may be wrong, but my understanding here is that the "fast path" is the scenario when the task turns out to be completed already at the point you want to do an await continuation. Since it is already complete, a lot of the overhead in setting up the continuation and leaving the current method can be avoided.