I am initially a native C ++ programmer, in C ++ every process in your program is tied to your code, i.e. nothing happens if you do not want it. And every bit of memory is allocated (and freed) according to what you wrote. So, productivity is your responsibility, if you do good, you get excellent performance.
(Note. Please do not complain about code that you havenโt written yourself, such as STL, this is unmanaged C ++ code in the end, this is a significant part).
But in managed code, such as code in Java and C #, you do not control every process, and the memory is โhiddenโ to some extent or not under your control. And that makes performance something relatively unknown, basically you are afraid of poor performance.
So my question is: what problems and bold lines should I take care of and keep in mind in order to achieve good performance in managed code?
I could only think of some practices, such as:
- Awareness of boxing and unboxing.
- Choosing the right collection that best suits your needs and has the lowest operating costs.
But they never seem sufficient and even convincing! In fact, perhaps I should not have mentioned them.
Please note that I am not asking to compare C ++ VS C # (or Java) code, I just mentioned C ++ to explain the problem.
Tamer shlash
source share