[Live-devel] possible candidate for patch (Groupsock.cpp)

Ross Finlayson finlayson at live555.com
Thu Mar 29 14:31:36 PDT 2007


>I noticed strange performance troubles on server side (CPU usage was
>more than usually) when streaming huge JPEG files. After few minutes of
>researching I noticed that for sending each RTP packet we call
>"outputToAllMemberExcept" function even if we don't have any member. So
>basicaly it's useless? Here's patch:
>
>@@ -269,11 +269,14 @@
>      statsGroupOutgoing.countPacket(bufferSize);
>
>      // Then, forward to our members:
>-    int numMembers =
>-      outputToAllMembersExcept(interfaceNotToFwdBackTo,
>+    int numMembers = 0;
>+    if (!members().IsEmpty()) {
>+        numMembers =
>+          outputToAllMembersExcept(interfaceNotToFwdBackTo,
>                                ttlToSend, buffer, bufferSize,
>                                ourSourceAddressForMulticast(env));
>      if (numMembers < 0) break;
>+    }
>
>      if (DebugLevel >= 3) {
>        env << *this << ": wrote " << bufferSize << " bytes, ttl "
>
>
>After applying this patch CPU usage normalized again. Can you please
>comment is patch correct or no?

Yes, it's OK - although I'm very sceptical about it having a 
significant effect on performance.  Your change doesn't save much 
more than a function call.
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list