Best practices of high-performance network applications

淺唱寂寞╮ 提交于 2019-12-03 01:07:50

What you observe is the side-effect of your media player setting clock resolution of your machine to 1 ms.

This happens only during the play

The side-effect is - your app has smaller timeslices and this imporves your app because you probably had lot of CPU stolen from your app and with longer timeslices - for longer time.

To test it you can simply set the timer resolution within your app to 1ms and compare performance without media playing.

Should be the same as if with no clocres setting but with media playing.

g .

It has been many years since I wrote network protocol related code, but I'll offer a guess.

I suspect this is an issue of throughput and latency. Playing music is introducing I/O contention and adding latency in transmitting the packets. However, the added latency is likely causing the packets to queue and thus batched increasing throughput.

To address this in your code, you might try sending the packets in batches yourself. I am assuming that you are sending each packet to the system for transmission as the data becomes ready. Group multiple packets and send them to the system at the same time. Even just a group of two or three packets could make a dramatic difference especially if you are introducing your own small delay between each system call.

I couldn't find any directly relevant links from a quick search on Google. However, you can see the concept in this discussion of network tuning for Linux or in this FAQ which describes techniques such as batching to improve throughput.

Foobar got many plugins written by different people. These may be the cause of your issue. I propose you to come closer to the real reason. Try to switch off plugins one by one performing your test each time a plugin is disabled.

Hope the idea will help.

This sounds like TSP/IP managing throughput based on it's primitive algorithm. The white paper here should give more background. http://www.asperasoft.com/?gclid=CICSzMqD8Z0CFShGagod_ltSMQ Their product is a UDP protocol that works very well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!