2 ms·
C# has value types and is Java like. I assume you know of it and have your reasons, just couldn't help but point it out.
by Guvante 12y ago
C# has value types and is Java like.
I assume you know of it and have your reasons, just couldn't help but point it out.
- pkolaczk 12y agoEven without value types, Java/C# can do probably much better on the pointer vector case than C++, thanks to allocation from contiguous region and automatic memory defragmentation. It is very likely all the objects referenced from the vector would be placed in a contiguous memory region which is easy to prefetch for the CPU (sure, still not as fast as inlining them into array). This is completely different than in C++ where subsequent dynamic allocations return pointers scattered around the whole heap, especially after long run.