hprose / hprose-dotnet

Hprose 3.0 for .NET
MIT License
383 stars 98 forks source link

性能问题,cpu过高30+% #87

Closed zhaxg closed 3 months ago

zhaxg commented 4 months ago

代码在public class TcpHandler : IHandler --> private async Task Send(Stream netStream, ConcurrentQueue<(int index, Stream stream)> responses) ---> while (!responses.TryDequeue(out response)) 这句话从队列取值,会一致循环,实际上客户端并不是在请求,没有数据加入队列,是否应该改进检测到请求再循环, 比如使用SemaphoreSlim 这个信号量判断?

zhaxg commented 4 months ago

看到了maser分支和3.0分支的代码是有区别的了,我再测试一下

zhaxg commented 4 months ago

master分支测试正常