|
|
Warp wrote:
> I have no idea about the principles used in C#, but if it's anything like
> Java, the biggest problem is not so much speed as memory usage. In Java
> I don't think there's any way around the problem that you cannot create
> a data container where each element takes as much memory as the total size
> of the members of the object, nothing more. The smaller the object is, the
> worse the memory usage overhead relative to this size.
Wasn't it John Carmack who said that Java is a great way of doing things
at 1/10th the speed they should be done at? :)
Anyway, one of the first things I noticed in looking over C# is the
difference in structs and classes. Basically, a Class is the same as a
C++ struct / class, with the indirection et al, allocated on the heap.
A struct, on the other hand, has no member functions, and is a simple
collection of the base data types all allocated on the stack. Very
sparse memory usage, and very fast, either as individual instances or in
collections.
--
...Ben Chambers
www.pacificwebguy.com
Post a reply to this message
|
|