Shawn Wilsher wrote:
> Mike Shaver wrote:
>> Edumacate me! :)
> Sure thing. I was playing around with shark, with this patch applied to
> the download manager:
>
http://hg.mozilla.org/users/sdwilsh_shawnwilsher.com/storage-async/index.cgi/file/0d48c200ffb3/dm.shark >
>
> And then applied this on top of the current async storage work:
>
http://hg.mozilla.org/users/sdwilsh_shawnwilsher.com/storage-async/index.cgi/file/0d48c200ffb3/storage.shark-playing >
>
> I'm going to paste some of the results in this message - I saved this
> shark profiles so I can get more data from them. (I apologize for any
> formatting issues in advance)
>
> Size = 1
> 16.6% 16.6% libSystem.B.dylib mach_msg_trap
> 2.7% 2.7% XUL XPCWrappedNative::CallMethod(XPCCallContext&,
> XPCWrappedNative::CallMode)
> 2.2% 2.2% libmozjs.dylib js_Interpret
> 2.1% 2.1% libmozjs.dylib SearchTable(JSDHashTable*, void
> const*, unsigned, JSDHashOperator)
> 2.1% 2.1% libSystem.B.dylib pread$UNIX2003
> 1.9% 1.9% XUL XPCWrappedNative::FindTearOff(XPCCallContext&,
> XPCNativeInterface*, int, unsigned*)
> 1.7% 1.7% libmozjs.dylib js_LookupPropertyWithFlags
> 1.6% 1.6% libSystem.B.dylib getattrlist$UNIX2003
> 1.6% 1.6% libnspr4.dylib _PR_Darwin_x86_AtomicDecrement
> 1.5% 1.5% libnspr4.dylib _PR_Darwin_x86_AtomicIncrement
> 1.2% 1.2% XUL
> XPCConvert::NativeInterface2JSObject(XPCCallContext&,
> nsIXPConnectJSObjectHolder**, nsISupports*, nsID const*, JSObject*, int,
> int, unsigned*)
> 1.2% 1.2% XUL SearchTable
> 1.2% 1.2% libSystem.B.dylib pthread_mutex_unlock
> 1.2% 1.2% commpage [libSystem.B.dylib] __spin_lock
> 1.1% 1.1% libmozjs.dylib JS_GetReservedSlot
>
> Size = 10
> 10.9% 10.9% libSystem.B.dylib mach_msg_trap
> 3.4% 3.4% libmozjs.dylib js_Interpret
> 2.4% 2.4% XUL XPCWrappedNative::CallMethod(XPCCallContext&,
> XPCWrappedNative::CallMode)
> 1.9% 1.9% XUL XPCWrappedNative::FindTearOff(XPCCallContext&,
> XPCNativeInterface*, int, unsigned*)
> 1.9% 1.9% libmozjs.dylib js_LookupPropertyWithFlags
> 1.7% 1.7% XUL SearchTable
> 1.7% 1.7% libSystem.B.dylib pread$UNIX2003
> 1.7% 1.7% libnspr4.dylib PR_AtomicIncrement
> 1.7% 1.7% commpage [libSystem.B.dylib] __memcpy
> 1.5% 1.5% libnspr4.dylib _PR_Darwin_x86_AtomicIncrement
> 1.3% 1.3% libmozjs.dylib js_Invoke
> 1.3% 1.3% libSystem.B.dylib getattrlist$UNIX2003
> 1.3% 1.3% commpage [libSystem.B.dylib] __spin_lock
> 1.1% 1.1% XUL XBLResolve(JSContext*, JSObject*, long, unsigned,
> JSObject**)
> 1.1% 1.1% XUL SelectorMatches(RuleProcessorData&,
> nsCSSSelector*, int, nsIAtom*, int*)
> 1.1% 1.1% libmozjs.dylib SearchTable(JSDHashTable*, void
> const*, unsigned, JSDHashOperator)
> 1.1% 1.1% libSystem.B.dylib pthread_mutex_unlock
> 1.1% 1.1% XUL PL_DHashTableOperate
> 1.1% 1.1% XUL
> nsCSSFrameConstructor::FindFrameWithContent(nsFrameManager*, nsIFrame*,
> nsIContent*, nsIContent*, nsFindFrameHint*)
> 1.1% 1.1% HIServices ICMapping::GetIndMapEntry(long, long*,
> ICMapEntry*)
> 1.1% 1.1% HIServices
> ICDataConverter::GetMappingFromPropList(void const*, long, void*, long*)
>
> Size = 25
> 17.4% 17.4% libSystem.B.dylib mach_msg_trap
> 4.4% 4.4% libmozjs.dylib js_Interpret
> 2.2% 2.2% XUL XPCWrappedNative::CallMethod(XPCCallContext&,
> XPCWrappedNative::CallMode)
> 2.2% 2.2% libmozjs.dylib js_LookupPropertyWithFlags
> 2.0% 2.0% libSystem.B.dylib pread$UNIX2003
> 2.0% 2.0% commpage [libSystem.B.dylib] __spin_lock
> 1.8% 1.8% XUL XPCWrappedNative::FindTearOff(XPCCallContext&,
> XPCNativeInterface*, int, unsigned*)
> 1.5% 1.5% XUL SearchTable
> 1.5% 1.5% libmozjs.dylib js_SearchScope
> 1.3% 1.3% libmozjs.dylib SearchTable(JSDHashTable*, void
> const*, unsigned, JSDHashOperator)
> 1.1% 1.1% libmozjs.dylib js_Invoke
> 1.1% 1.1% commpage [libSystem.B.dylib] __memcpy
> 1.1% 1.1% commpage [libSystem.B.dylib] __bzero
>
> Size = 50
> 14.8% 14.8% libSystem.B.dylib close$UNIX2003
> 9.5% 9.5% libSystem.B.dylib mach_msg_trap
> 3.2% 3.2% libSystem.B.dylib pread$UNIX2003
> 2.8% 2.8% libmozjs.dylib js_Interpret
> 2.5% 2.5% XUL XPCWrappedNative::CallMethod(XPCCallContext&,
> XPCWrappedNative::CallMode)
> 2.5% 2.5% libmozjs.dylib SearchTable(JSDHashTable*, void
> const*, unsigned, JSDHashOperator)
> 1.9% 1.9% commpage [libSystem.B.dylib] __memcpy
> 1.7% 1.7% XUL XPCWrappedNative::FindTearOff(XPCCallContext&,
> XPCNativeInterface*, int, unsigned*)
> 1.5% 1.5% XUL SearchTable
> 1.5% 1.5% commpage [libSystem.B.dylib] __spin_lock
> 1.3% 1.3% libmozjs.dylib js_LookupPropertyWithFlags
> 1.1% 1.1% libSystem.B.dylib pthread_mutex_lock
>
> Some comments on all this:
> We tend to spend a lot of % of scope in mach_msg_trap - and a good chunk
> of this is in CoreGraphics. The amount in OSServices seems to drop,
> with the exception of size = 25 (I should probably re-run that since it
> seems like an anomaly all around) as the size increases.
> For size = 1, we are in CFRunLoopRunSpecific (again with mach_msg_trap),
> but CoreGraphics still beats it by a long shot.
>
> So, I think in this case our biggest hit is all the drawing. With that
> said, I've never used shark before today, so I'm not sure if I got all
> the useful information out of it I could have, or if there's something
> else I should have gotten. Feedback is, of course, appreciated.
More on this. I've uploaded the shark profiles (per bsmedberg's
request), and they can be found here:
http://files.shawnwilsher.com/2008/6/12/I re-ran the 25 size one (size = 25(2).mshark), and get similar results,
so maybe it's not an anomaly. Note, this is adding ~590 download items
to the download manager window.
Follow-ups to dev.platform.
Cheers,
Shawn