Message passing between threads: Java 4 times faster than D

Marco Leise Marco.Leise at
Thu Feb 9 11:49:46 PST 2012

Am 09.02.2012, 20:35 Uhr, schrieb Andrei Alexandrescu  
<SeeWebsiteForEmail at>:

>>> If we're doing one allocation per
>>> message passed, that might explain the 4x performance difference (I
>>> have no trouble figuring Java's allocator is this much faster than  
>>> D's).
>>> Andrei
>> Well, what does +1 Variant and +1 LinkedListNode sum up to?
> Sorry, I don't understand...
> Andrei

There are at least 2 allocations, one for the Variant and one for the new  
node in the linked list aka message box. But from what you wrote it sounds  
like a Variant doesn't allocate unless the contained data exceeds some  
internal storage. Sean found another possible allocation in the other  
branch of this discussion.

More information about the Digitalmars-d mailing list