C#
  Home arrow C# arrow Page 5 - Using Late Bound COM Objects
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
C#

Using Late Bound COM Objects
By: Wrox Team
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 21
    2002-11-18

    Table of Contents:
  • Using Late Bound COM Objects
  • Introductory Concepts
  • Late Binding in .NET: The Basic Invocation
  • Late Binding in .NET: With a Runtime Callable Wrapper Available
  • Late Binding in .NET: Monitoring Performance of the Various Invocation Methods
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Using Late Bound COM Objects - Late Binding in .NET: Monitoring Performance of the Various Invocation Methods


    (Page 5 of 6 )

    We have seen a variety of ways to bind to a COM object at runtime. As I pointed out in the beginning of this article, late binding itself carries some rather severe performance penalties. To avoid impacting performance further, you will want to evaluate the relative speed of these invocation methods for your own COM object. To do this, I suggest maintaining a simple test harness to invoke the target COM object each of the three ways on your version of Visual Studio .NET. This will help you make choices for your current code. The tests should then be re-run when the final .NET bits are released to determine if your invocation strategy needs to change. To help you get started, our .NET project provides a simplistic performance testing harness. These final routines of the project call each of the three invocation examples 5,000 times and report the number of seconds required for each set of 5,000 invocations (as a caveat, this is a simplistic example. The COM methods are only passing small strings, and everything is instantiated locally).

    In my testing, the simple COM instantiation, without an RCW, was sometimes marginally faster. If the application timed this "simple" routine before timing the two RCW-related methods, the simple example was generally about 1 second faster. On the other hand, if the simple example was timed last, the performance of all three methods was equivalent. Try these timings on your own late-bound objects as your mileage may vary.

    Note that the .NET Framework SDK license prohibits formal benchmarking of the code at this time (a reasonable requirement considering we're working with beta code), so these are not authoritative recommendations in this area. Your mileage will vary from mine, and will undoubtedly also vary between Beta 2, Release Candidate 1, and the final released code.

    More C# Articles
    More By Wrox Team


     

    C# ARTICLES

    - Introduction to Objects and Classes in C#, P...
    - Visual C#.NET, Part 1: Introduction to Progr...
    - C# - An Introduction
    - Hotmail Exposed: Access Hotmail using C#
    - Razor Sharp C#
    - Introduction to Objects and Classes in C#
    - Making Your Code CLS Compliant
    - Programming with MySQL and .NET Technologies
    - Socket Programming in C# - Part II
    - Socket Programming in C# - Part I
    - Creational Patterns in C#
    - Type Conversions
    - Creating Custom Delegates and Events in C#
    - Inheritance and Polymorphism
    - Understanding Properties in C#






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT