• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Long term performance of NSConnection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Long term performance of NSConnection


  • Subject: Long term performance of NSConnection
  • From: Kevin Brock <email@hidden>
  • Date: Thu, 02 Jul 2009 12:29:21 -0700

We've got an application that uses some NSConnection objects to call between binaries. An application calls interfaces of an object which is vended by a daemon.

The calls between modules are made frequently, and during some testing I noticed a steady drop in perfomance of the application. I ran Shark, and saw that after a lot (> 1,000,000) calls across the API more than 95% of the time was being spent in 5 calls, all of which look like they're related to distributed objects:

lookUpConnectionForProxy
	30.5%
lookUpLocalProxyForWireID
	26.5%
lookUpLocalObjectForProxy
	22.8
lookUpOrCreateLocalProxyForObject
	8.2%
lookUpWireIDForProxy
	7.6%


I can't find any references to these functions on the net, and don't see anything in the docs that would explain this.


We use a long term, persistent connection. The degradation starts very soon.

Call
	Startup
	~10,000 calls
	~20,000 Calls
lookUpConnectionForProxy 	0.4%
	4.2%
	14.6%
lookUpLocalProxyForWireID 	0.8%
	12.4%
	15.7%
lookUpLocalObjectForProxy 	0.3%
	2.8%
	8.8%
lookUpOrCreateLocalProxyForObject 	0.5%
	3.3%
	4.8%
lookUpWireIDForProxy 	0.1%
	0.7%
	3.3%



Is there something we are missing about the usage of the connection object? It looks like there's some table internal to the connection that's not being cleaned up. When I graph the actual perormance hit taken by the application (secs/1000 connections) it's essentially linear increase in time from 0 to 500,000 connections.

When I run Shark on the daemon side for the > 1,000,000 call case it shows three calls consuming >97% of the time

Call
	Time
lookUpConnectionForProxy 	58%
lookUpWireIDForProxy 	28.9%
lookUpOrCreateLocalProxyForObject 	11.2%


I'd really appreciate any suggestions about why this might be happening.

Kevin Brock
email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Long term performance of NSConnection
      • From: AurĂ©lien HugelĂ© <email@hidden>
  • Prev by Date: Re: in search of a starter iphone painting tutorial or sample code
  • Next by Date: How do I get the version of AppKit.framework available in Cocoa Application Framework 10.5? Probably a dumb question I know..
  • Previous by thread: Re: Sorting an editable tableView of managed object
  • Next by thread: Re: Long term performance of NSConnection
  • Index(es):
    • Date
    • Thread