POV-Ray : Newsgroups : povray.off-topic : Microsoft may have done something right... : Re: Microsoft may have done something right... Server Time
10 Oct 2024 23:18:13 EDT (-0400)
  Re: Microsoft may have done something right...  
From: Chambers
Date: 22 Mar 2008 15:22:56
Message: <47e56aa0$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.