CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2006
    Posts
    82

    Tiny little question (Comparer)

    I recently found out the Comparer class that can be used to compare two objects that may potentially be null. It runs 3 times faster than any code you can write.

    I wonder if there is such class for checking equalities. (I.E. Invoking Equals method instead of CompareTo method)

    Also, please share with us on any little known class that exist in the API which we can use avoid writing boiler plate codes.

  2. #2
    Join Date
    May 2007
    Posts
    1,546

    Re: Tiny little question (Comparer)

    I recently found out the Comparer class that can be used to compare two objects that may potentially be null. It runs 3 times faster than any code you can write.
    In what situation have you measured it to be faster and what were you comparing it to? There's no reason why it'd be any faster than anything you could write yourself.
    www.monotorrent.com For all your .NET bittorrent needs

    NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.

  3. #3
    Join Date
    Feb 2009
    Posts
    56

    Re: Tiny little question (Comparer)

    It's the end-users' judgments over the speed if they have two code blocks to profile, clearly that the users are not allowed to know anything about the algorithms used to code for each of them means also this is a flawed theory. They still feed their dream anyway and debates go on.
    -----

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured