Skip to content
This repository was archived by the owner on May 28, 2019. It is now read-only.
This repository was archived by the owner on May 28, 2019. It is now read-only.

Performance issues #13

@RFlipper

Description

@RFlipper

I noticed serious performance issue related to using Stream.ReadAsync method which has huge overhead in Simple.MailServer.Mime.StringReaderStream.ReadLineAsync method

for (var i = 0; i < _buffer.Length; i++)
{
   var read = await BaseStream.ReadAsync(_singleBuf, 0, 1, cancellationToken); // <-- this is the issue
   if (read <= 0)

I believe the following articles are related to the issue:
https://ayende.com/blog/173345/the-cost-of-async-i-o-false-assumptions-and-pride
https://nbsoftsolutions.com/blog/await-async-in-c-and-why-synchrony-is-here-to-stay

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions