WinFX Trivia Quiz: What are the most used APIs in the BCL?

A guy on my team has been playing around with an API usage frequency tool… the idea is to gather data on the most used APIs in the framework.  What he does is scan the IL for all calls to methods and sum the number of calls for each API defined in the BCL.  

He recently ran this tool over a current build of Longhorn which contains a large managed code base.  Can you name any of the methods in the top 10?  Think about it a bit, it might be harder than you first think… I’ll post a hint tomorrow if folks are not in the right track.

Published 14 January 04 10:06 by BradA
Filed under: ,

Comments

# Albert said on January 14, 2004 11:00 PM:
String.Compare
# Jesse Ezell said on January 15, 2004 12:11 AM:
10. Microsoft.PlatformSpecificApi.Use();
9. Hardware.Ram.MaxOut();
8. Microsoft.Office.Crash();
7. System.Windows.BlueScreen.Display();
6. W3C.Standards.Ignore(true);
5. Secrets.UndocumentedClass.ReallyCoolMethod();
4. Marketing.Xmlizer.Xmlize(Everything);
3. System.Math.Random.CreateAcronym();
2. ScobleVisibleAttribute.ctor(false);
1. Drinks.KoolAid.Pour();




# Simon Smith said on January 15, 2004 3:17 AM:
String.Compare is good.
XmlDocument.SelectSingleNode and .SelectNodes
# sebastien lambla said on January 15, 2004 4:33 AM:
object.ToString()?
# Scott said on January 15, 2004 6:16 AM:
Control.Invalidate ?
Dispose ?
Debug.WriteLine ?
Stream.Read ?
# Eric Wilson said on January 15, 2004 6:58 AM:
- Anything in the String class (particularily String.Format).

- Probably the ctor for Exception.

- XPathNavigator.Select();

# Brad Abrams said on January 15, 2004 7:15 AM:
Good guesses so far... this is not really a hint, more of clarification. For the purposes of this question assume the BCL is only stuff in MSCorLib and System.dll -- so no xml.
# Ken Cowan said on January 15, 2004 7:21 AM:
Are you counting how many calls are in the source or which get called the most at runtime?

System.String functions. Do I need to guess which ones? .ctor and Compare would be my guess.

System.StringBuilder.

ArrayList and/or HashTable insert and enumerators.

Demand on various permissions.

ToString on various types

IntPtr.op_Equal

KC
# Josh said on January 15, 2004 8:10 AM:
Convert.ToXXX()
# Michael Giagnocavo said on January 15, 2004 8:20 AM:
System.Object::.ctor (maybe not called, but certainly used)
System.IO.MemoryStream.ReadByte
System.Text.StringBuilder::GetThreadSafeString
(and perhaps other string functions like NullTerminate?)

# Eric said on January 15, 2004 8:21 AM:
Probably a lower level than considered, but how about:
object.ctor()
object.Equals()
followed by the ctors for various integer types...

# Mike Marshall said on January 15, 2004 9:11 AM:
I'd have to go with object.ToString and its overrides, but those will probably come up separate in the statistics. how about object.GetType()?
# Brad Abrams said on January 15, 2004 3:26 PM:
Good comments... A couple of folks suggest string.Compare()... The most frequent overload of it is only the 51st most called api, with 295 calls.
51;System.String.Compare(System.String strA;System.String strB,Boolean ignoreCase;System.Globalization.CultureInfo culture);295

Other folks have suggested items higher on the list as well.

Here is your hint: Consider method calls that are not "hidden" by C# or VB syntax...
# Keith Hill said on January 15, 2004 6:08 PM:
String.Length
String.op_Equality / String.Equals
String.Empty
ArgumentException.ctor
ArgumentNullException.ctor
# Brad Abrams said on January 19, 2004 9:53 AM:
New Comments to this post are disabled

Search

Go

This Blog

Syndication

Page view tracker