Paralysis of analysis
Steven Schveighoffer
schveiguy at yahoo.com
Tue Dec 14 12:19:43 PST 2010
On Tue, 14 Dec 2010 15:13:36 -0500, Walter Bright
<newshound2 at digitalmars.com> wrote:
> Andrei Alexandrescu wrote:
>> The two words overhead comes from the vtable and the mutex.
>
> I don't think that overhead is a problem. For small numbers of values,
> one should use an array. The more complex containers are for larger
> numbers of values, where 2 words is insignificant.
The place I see it being an issue is for things like a map where the value
type is a linked list. It's quite conceivable that a map type like this
could have thousands of one-element linked lists, with a few scattered 2
or more element linked lists.
I don't think it's a common thing, but I think there can be solutions that
work around this issue. I agree the 2 words are not enough to dissuade
using classes for container types.
-Steve
More information about the Digitalmars-d
mailing list