Am 09.02.2012, 18:35 Uhr, schrieb Andrei Alexandrescu <seewebsiteforem...@erdani.org>:

On 2/9/12 6:10 AM, Gor Gyolchanyan wrote:
Generally, D's message passing is implemented in quite easy-to-use
way, but far from being fast.
I dislike the Variant structure, because it adds a huge overhead. I'd
rather have a templated message passing system with type-safe message
queue, so no Variant is necessary.
In specific cases Messages can be polymorphic objects. This will be
way faster, then Variant.

cc Sean Kelly

I haven't looked at the implementation, but one possible liability is that large messages don't fit in a Variant and must use dynamic allocation under the wraps. There are a number of ways to avoid that, such as parallel arrays (one array per type for data and one for the additional tags).

We must make the message passing subsystem to not use any memory allocation in the quiescent state. 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?

Reply via email to