Asynchronous operations performance
Posted
by
LicenseQ
on Stack Overflow
See other posts from Stack Overflow
or by LicenseQ
Published on 2009-02-22T22:34:45Z
Indexed on
2011/02/22
7:25 UTC
Read the original article
Hit count: 563
One of the features of asynchronous programming in .NET is saving threads during long running operation execution. The FileStream
class can be setup to allow asynchronous operations, that allows running (e.g.) a copy operation without virtually using any threads. To my surprise, I found that running asynchronous stream copy performs not only slower, but also uses more processing power than synchronous stream copy equivalent.
Is there any benchmark tests were done to compare a synchronous vs asynchronous operation execution (file, network, etc.)? Does it really make sense to perform an asynchronous operation instead of spanning separate thread and perform synchronous operation in server environment if the asynchronous operation is times slower than the synchronous one?
© Stack Overflow or respective owner