3 ms·
As with most compacting collecting languages memory allocation is a space check and a pointer increment. In C++ new has to do quite a bit more. It is about Ja
by stonemetal 17y ago
As with most compacting collecting languages memory allocation is a space check and a pointer increment. In C++ new has to do quite a bit more. It is about Java but C# is capable of the same.
http://www.ibm.com/developerworks/java/library/j-jtp09275.html http://www.ibm.com/developerworks/java/library/j-jtp09275.ht...
Also note that C++'s memory model is "single threaded" new must grab a global lock where as C#'s memory allocator is designed with threads in mind so no locking overhead.