On Thu, 23 Jul 2009 14:06:12 -0400, Jarrett Billingsley <[email protected]> wrote:

On Thu, Jul 23, 2009 at 1:20 PM, Steven
Schveighoffer<[email protected]> wrote:


However, when I realized that with a custom allocator, I could tremendously
increase performance, I had to switch to structs.

Um, did you?  Because you can have custom allocators for classes too..

First, there were other reasons, such as I don't need polymorphism or interfaces for those node types, so switching to structs helped eliminate bloat for those features.

What I did was allocate an array of structs vs. allocating each node, which uses the GC less. The less you use the GC the better when it comes to performance :)

Can you do that with classes, I don't know. I thought it was impossible to allocate several classes in one block. It was pretty easy to do the custom allocator with structs...

-Steve

Reply via email to