swarm-support
[Top][All Lists]
Advanced

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

Re: Scheduling


From: Marcus G. Daniels
Subject: Re: Scheduling
Date: 27 Mar 2001 11:52:55 -0800
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "RL" == Rob Leclerc <Rob> writes:

RL> As it stands it *appears* that my implementation is quite a bit
RL> slower than that in StarLogo based similar grid sizes. 

That's quite possible.  StarLogo is coded in a very delicate way to be
fast for grid-oriented things.

RL> Part of my implementation is that I have each agent schedule their
RL> own activities as opposed to having the model itself activating those
RL> activities.  I am wondering how much of a performance hit I would
RL> get from this or if there might be some other intrinsic reasons
RL> why this would be slower. 

The main thing you will get a performance hit from is dynamic insertion of new
events.  There should not be a lot of overhead from adding depth to models
or having agents schedule their own actions.

There's a lot that can be done to speed-up models, but the first step is
to get profiling information.  (e.g. jdkswarm -Xprof)

Some of the options are:

  0) Algorithmic optimizations -- profiling makes these obvious

  1) Use language-specific homogeneous ForEach FActions -- that
     eliminates method dispatch costs and cross language lookups.

  2) Likewise, schedule simple actions with language-specific `FActions'.

  3) Identify places where cross languages calls are expensive and 
     substitute pure Java code.  Or, even better, contribute features to Swarm
     so that they run in fast chunks for native-code performance. 

  4) Use the GNU Java compiler, gcj, to compile the model and Swarm
     stubs down to native code.  I recently submitted changes to GCJ
     to make this work.  See the address@hidden mailing list
     archives if you want to fool around with it.  The result of this
     is you get a simple executable.  (Unlike what I talked about at
     SwarmFest last year this doesn't involve a JVM at all.)
  
     The model I'm working on now had about a 1.3 factor speedup without any 
     other changes.  Also, the quality of profiling information from this
     is much better than from JVMs, since it goes all the way down
     through Java runtime support, Swarm itself, and system C libraries.

One of these days I'll add a feature to store references to Swarm-side
native objects *in* Java objects, but that will require subclassing
agents from SwarmObject.  That would give a factor of two or speed-up
for many models, especially those coded in naive ways..

                  ==================================
   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]