Re: Structs insted of classes for Performance

2014-04-20 Thread anonymous via Digitalmars-d-learn
On Sunday, 20 April 2014 at 18:08:19 UTC, Frustrated wrote: In D though, I guess because of the GC(but which is why I am asking because I don't know specifically), classes could be much slower due to all the references causing the GC to take longer scan the heap and all that. If allocate or fre

Re: Structs insted of classes for Performance

2014-04-20 Thread Frustrated via Digitalmars-d-learn
On Sunday, 20 April 2014 at 16:56:59 UTC, Ali Çehreli wrote: My understanding is not perfect. There may be compiler and CPU optimizations that I am not aware of. On 04/20/2014 08:03 AM, Frustrated wrote: > is the only argument really about performance when creating > structs vs creating classe

Re: Structs insted of classes for Performance

2014-04-20 Thread Ali Çehreli via Digitalmars-d-learn
My understanding is not perfect. There may be compiler and CPU optimizations that I am not aware of. On 04/20/2014 08:03 AM, Frustrated wrote: > is the only argument really about performance when creating > structs vs creating classes Not only creating but also when using. A class variable is

Structs insted of classes for Performance

2014-04-20 Thread Frustrated via Digitalmars-d-learn
I know the difference between a struct and a class but I remember seeing somewhere that structs are much faster than classes in D for some strange reason. I'm not worried too much about class allocation performance because I will try and use classes when they will not be created frequently an