Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6153039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:01:32+00:00 2026-05-23T20:01:32+00:00

Quick little question… I know that sometimes in other languages libraries have part of

  • 0

Quick little question…

I know that sometimes in other languages libraries have part of their code written in platform-specific straight C for performance reasons. In such cases you can get huge performance gains by using library code wherever possible.

So does the .NET platform do this? Is Microsoft’s implementation of the Base Class Library optimized in some way that I can’t hope to match in managed code?

What about something little like using KeyValuePair as a type-safe tuple struct instead of writing my own?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:01:33+00:00Added an answer on May 23, 2026 at 8:01 pm

    As far as I know, the .NET Framework hasn’t been compiled in a way that creates hooks into some otherwise-inaccessible hardware acceleration or something like that, so for simple things like KeyValuePair and Tuple, you’re probably safe rolling your own.

    However, there are a number of other advantages to using standard framework classes, and I’d hesitate to write my own without a strong reason.

    1. They’re already written, so why give yourself extra work?
    2. Microsoft has put their code through a pretty rigorous vetting process, so there’s a good chance that their code will be more correct and more efficient than yours will.
    3. Other developers that have to look at your code will know exactly what to expect when they see standard framework classes being used, whereas your home-brewed stuff might make them scratch their heads for a while.

    Update

    @gordy also makes a good point, that the standard framework classes are being used by everybody and their dog, so there will be a slight performance gain simply due to the fact that:

    1. the class likely won’t have to be statically instantiated or just-in-time compiled just for your code,
    2. the class’s instructions are more likely to already be loaded in a cache, since they’ll likely have been used recently by other parts of code. By using them, you’re less likely to need to load the code into a cache in the first place, and you’re less likely to be kicking other code out of the cache that’s likely to be used again soon.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Quick question. What do you think, I have a few sites that use a
Quick question, looking for some recommendations. I have a site that will be requesting
I have a quick little application and wanted to give a try to develop
I'm writing code like this, doing a little quick and dirty timing: var sw
Hi I posted a question a little earlier and I had some replies that
Quick question. There is a legacy website (that is not under my control and
I am writing my first little Access 2003 application. I have two queries that
I'm writing a quick little money tracking rails app for fun that allows a
Quick question: I've run into a little issue, where I just need some insight
Quick question about Ruby forking - I ran across a bit of forking code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.