.NET Framework Performance Signatures

I love Rico’s performance quizzes in general, but the last one has something especially interesting: a link to a file listing all members in the Framework and their estimated performance signatures (perf characteristic based on the number of allocations in the member).

Now, I only wish I had an fxcop rule warning me when I call some of the expensive members in loops, low on the callstack, on the UI thread, or in any other performance sensitive places.

Published 26 January 07 04:52 by kcwalina

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Peter Ritchie said on January 26, 2007 9:18 PM:

You read my mind!  I was thinking more of being called on the UI thread; but similar premise...

# Impersonation Failure said on January 27, 2007 9:43 AM:

Rico Mariani included a very interesting file in his latest performance quiz post which shows all the

# john said on January 29, 2007 7:17 PM:

I've got an fxcop rule that does something similar to what your asking.  It looks for looping branch logic in the IL, then scans the IL in the loop for calls to "complex" properties.  Complex meaning any property that does more than just return a field.  It wouldnt be a stretch to extend this to look for other expensive members.  The only thing is the time it takes to run the rule would be fairly long on any good sized project.

# Patrick Smacchia said on January 30, 2007 5:03 AM:

The new NDepend's Level metric answer exactly your concern. See its definition here http://www.ndepend.com/Metrics.aspx#Level

What you wish can be answered with some CQL constraints that looks like:

WARN IF Count >0 IN SELECT METHODS OUT OF "MyApp.GUI" WHERE IsUsedBy "MyApp.GUI" AND MethodLevel < 5

As long as tools don't harness dynamic analysis info, there won't be any algo that will do better than a coarse approximation. A good point however is that the CQL constraint can be refined at whim until it answers exactly the architect need. For example the following CQL constraint helps classifying low level methods between those that can be called by GUI and those that can be called by BackGroundThreadProc:

WARN IF Count >0 IN SELECT METHODS OUT OF "MyApp.GUI" WHERE IsUsedBy "MyApp.GUI" AND IsUsedBy "MyApp.MyType.BackGroundThreadProc()" AND MethodLevel < 5

# Nikhil's Blog said on June 29, 2007 9:37 PM:

Today I attended an interesting talk on Performance Signatures by Rico Mariani . According to his experience,

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required
Page view tracker