Class size and performance
Unknown W. Brackets
unknown at simplemachines.org
Sun Jan 20 17:59:46 PST 2008
Ah, thank you. That makes a lot of sense. I thought it was interesting
that it was near the 64 mark, but didn't realize there were both vtbl
and monitor pointers.
Sounds like this would probably be resolved by creating a custom
allocator, which preallocates space for a number of instances in chunks,
which was already an idea I had to test for optimizing performance (the
objects themselves will most likely be deleted all at once, or not, so
this should be a good optimization.)
Thanks.
-[Unknown]
Sean Kelly wrote:
> Without version(slow), TestClass will occupy 64 bytes, 4 bytes for the
> vtbl ptr, 4 bytes for the monitor ptr, and 56 bytes for the data. With
> version(slow), the GC will reserve 128 bytes for the same class, because
> it will need 68 bytes of storage.
>
>
> Sean
More information about the Digitalmars-d-learn
mailing list