简体   繁体   English

是什么减慢了GKSession的网络吞吐量?

[英]what slows down GKSession's network throughput?

I implemented an app that does real time broadcasting of music from one iphone to another based on Ray Wenderlich's tutorial about GKSession and Matt Ghallagher's tutorial on audio streaming. 我基于Ray Wenderlich关于GKSession的教程和Matt Ghallagher关于音频流的教程 ,实现了一个应用程序,可以将音乐从一个iPhone实时广播到另一个iPhone。

Everything worked perfectly.. until we've decided to replace the poker game UI with that of our own. 一切正常。.直到我们决定用自己的游戏代替UI。 The result is that suddenly the networking throughput drops dramatically. 结果是网络吞吐量突然下降。 Below is a profiler snap shot of the server 下面是服务器的探查器快照 这是服务器的探查器

Here is a snapshot of the client of the original app 这是原始应用程序客户端的快照 在此处输入图片说明

and here is a snapshot of the client of the app with the updated UI (host is the same as old one): 这是具有更新的UI的应用程序客户端的快照(主机与旧的相同): 在此处输入图片说明

One thing to keep in mind is that we didn't just change the UI.. we also changed a bit of the networking code.. which is what I believe is slowing things down (I did a lot of performance testing ont the UI.. eliminating all the bells and whistles and the I got the same slow down).. 要记住的一件事是,我们不仅更改了UI。我们还更改了一些网络代码。这是我认为正在减慢速度的事情(我在UI上进行了大量性能测试。消除所有的风吹草动,我的速度变慢了。)

any ideas? 有任何想法吗? some suggested that keeping a GKSession broadcasting availability slows thing down a bit.. I made sure that that's not the case in my app.. 有些人建议保持GKSession广播的可用性会使速度变慢。.我确保在我的应用中不是这种情况。

Update: After looking at the network analysis (using instruments) it seems that there is a lot of network activity by some unknown process.. is there a way to detect that unknown process? 更新:在查看了网络分析(使用工具)之后,似乎某个未知进程进行了大量网络活动。是否有办法检测该未知进程? this is the screen shot for the good app: 这是好应用程序的屏幕截图: 在此处输入图片说明

and here is the screen shot for the bad app: 以下是不良应用的屏幕截图: 在此处输入图片说明

notice the difference between the two: in one other uses a lot more network activity than the other.. ideas? 注意到两者之间的区别:在另外一个使用了更多的网络活动比其他..想法?

Turns out that I had two different objects pointing to the same GKSession instance variable.. for some reasons that slowed things down.. the frustrating part is that GKSession is so opaque and so any debugging is pretty much guestimation. 原来,我有两个不同的对象指向同一个GKSession实例变量。出于某种原因,它们使事情变慢了。令人沮丧的部分是,GKSession如此不透明,因此任何调试都非常客串。 Lesson learned.. I'll just directly use bonjour next time. 获得的经验教训..下次我将直接使用bonjour。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM