Best practices of high-performance network applications

后端 未结 4 682
被撕碎了的回忆
被撕碎了的回忆 2021-02-04 11:19

While testing out a UDP multicast server that I\'ve written on Windows 7 Ultimate x64, I came across a most curious thing. Playing music with foobar2000 in the background signif

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-04 11:55

    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.

提交回复
热议问题