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 7052529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:23:40+00:00 2026-05-28T03:23:40+00:00

I am originally a native C++ programmer, in C++ every process in your program

  • 0

I am originally a native C++ programmer, in C++ every process in your program is bound to your code, i.e, nothing happens unless you want it to happen. And every bit of memory is allocated (and deallocated) according to what you wrote. So, performance is all your responsibility, if you do good, you get great performance.

(Note: Please don’t complain about the code one haven’t written himself such as STL, it’s a C++ unmanaged code after all, that is the significant part).

But in managed code, such as code in Java and C#, you don’t control every process, and memory is “hidden”, or not under your control, to some extent. And that makes performance something relatively unknown, mostly you fear bad performance.

So my question is: What issues and Bold Lines should I look after and keep in mind to achieve a good performance in managed code?

I could think only of some practices such as:

  • Being aware of boxing and unboxing.
  • Choosing the correct Collection that best suites your needs and has the lowest operation cost.

But these never seem to be enough and even convincing! In fact perhaps I shouldn’t have mentioned them.

Please note I am not asking for a C++ VS C# (or Java) code comparing, I just mentioned C++ to explain the problem.

  • 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-28T03:23:41+00:00Added an answer on May 28, 2026 at 3:23 am

    There is no single answer here. The only way to answer this is: profile. Measure early and often. The bottlenecks are usually not where you expect them. Optimize the things that actually hurt. We use mvc-mini-profiler for this, but any similar tool will work.

    You seem to be focusing on GC; now, that can sometimes be an issue, but usually only in specific cases; for the majority of systems the generational GC works great.

    Obviously external resources will be slow; caching may be critical: in odd scenarios with very-long-lived data there are tricks you can do with structs to avoid long GEN-2 collects; serialization (files, network, etc), materialization (ORM), or just bad collection/algorithn choice may be the biggest issue – you cannot know until you measure.


    Two things though:

    • make sure you understand what IDisposable and “using” mean
    • don’t concatenate strings in loops; mass concatenation is the job of StringBuilder
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Originally, I just want to verify that session_start locks on session. So, I create
I'm analysing a deadlock that's occurring when using a native library alongside managed code.
I'm a Windows (native, not .NET) programmer and I'd like to port an application
I have a C++ DLL (no code) that I want to expose to .NET
At the moment all I want this program to do is run without any
I am using the Java Native Interface to include some statically compiled code in
Originally there was the DAL object which my BO's called for info and then
Originally I thought to ask if there would be an easy way to provide
Originally I though I'll just take a screenshot of my app on the iPhone
Originally I had a design problem where I needed five subclasses of a superclass,

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.