'BufferedStream(with WebStream)'s Read() method extreme slow

I have a BufferedStream, it has the following definition:

_inputBuffer = new BufferedStream(webStream, 10240);

When I run _inputBuffer.Read(new byte[1], 0, 1) in dotnet Framework 4.5, it works so well.

But in dotnet core(both 2.1 and 3.1), things are getting very weird:

In most of calling, _inputBuffer.Read(new byte[1], 0, 1) works with no problem, but in some calling, it's performance becomes extreme slow(cost about 200ms, even more).

I've ruled out causes of network and environment, is it caused by bad calling of mine, or different implementations of those frameworks?

Hope anybody could explain this wired thing for me, thanks guys.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source