swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Speed decrease between 2.0 and 2.1?


From: Marcus G. Daniels
Subject: Re: Speed decrease between 2.0 and 2.1?
Date: 23 May 2000 11:18:32 -0700
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "DC" == d e cox <address@hidden> writes:

DC> I too have seen a significant slow-down going to 2.1 from 2.0,
DC> with 2.1.1 being about 8x slower.

In your simulation and Jason's the bottleneck is in ActionForEach.

This bottleneck was introduced when the way a method gets called
became more complex with Java.  In 2.0.1 that cost was absorbed by the
Java layer.  Every time Swarm issued a call, the Java layer would
hear: "Hey you!  Do this!".  Unfortunately "this" was indefinite and
it had to go looking around to figure out what "this" really was.
This made the Java layer really slow, initially.

Thus, in 2.1 we decided to make the callout mechanisms have more
information, so that "this" would not be indefinite.  Now, the MessageProbes,
tclobjc (the module that talks to Tk to do graphics things), and the
activity library all use the same means to issue calls.  The advantage
is that everything goes through one well-typed mechanism that can be
traced and extended for new languages, optimized, etc.

One way the callout mechanism has been extended is to support COM
(Component Object Model) in addition to Java.

One way it was optimized was to distinguish between heterogenous sets
and homogenous sets.  The patches I posted for traffic-0.3 switch from
using general Objective C messages for each car, to specific
pre-dispatched messages.  Before, every time a message was sent to a
car, the Objective C runtime would have to check to see if there were
different ways to perform the message.  But if the message is fixed,
say, ChangeLanes (it is always the same lines of code that run; there
is only one kind of car), it is silly to do this lookup work over and
over again for every car -- you only need that if different kinds of
cars change lanes in different ways.

2.1 slowed down for the heterogenous ForEach case (what you get
with ActionForEach), because the lookup work for how to perform
a message had to handle more contingencies.

Unfortunately, it is hard to optimize the general callout mechanism to
be as fast as it was when we could assume all-the-world was Objective C, and
we were willing to conflate types like integers and objects.

But one idea would be to have a new interface like ActionForEachHomogenous.
This could specialize the case of a no-parameter call into a simple
pre-dispatched function call.  That ought to be faster than 2.0.1.

Sorry if I'm not explaining this well.  Just ask and I'll try to clarify.

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]