swarm-support
[Top][All Lists]
Advanced

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

fewer Objective C messages within Swarm


From: Marcus G. Daniels
Subject: fewer Objective C messages within Swarm
Date: 06 Jul 2001 19:02:02 -0600
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.7

In today's snapshot there's a build configuration which significantly
reduces the number of Objective C messages within Swarm itself.

  ftp://ftp.swarm.org/pub/swarm/src/testing/swarm-2001-07-06.tar.gz

The speedup is sensitive to the kind of model, but for the Java model
I'm working on the speed up is about 20 %.  Basically, the more
complex of a model it is (in terms of Swarm scheduling), the faster it
will be.  This was a fairly large patch to Swarm, and although it
doesn't cover all potential Objective messages within Swarm, it chops
down the tall trees...  More work is possible -- see
src/{defobj/collections/activity}/macros.h if you are curious.

Note: Objective C messaging is very fast.  To give you an idea, my 20 %
speedup (over a mere five seconds) involved eliminating 34,000,000
message dispatches!

A hassle is that it requires this compiler patch. 
(made against GCC 3.0)

*** /home/mgd/objc-act.c        Fri Jul  6 17:30:03 2001
--- objc-act.c  Thu Jun 14 19:08:40 2001
***************
*** 7119,7129 ****
    char *buf;
  
    /* Synth the storage class & assemble the return type.  */
- #if 0
    sc_spec = tree_cons (NULL_TREE, ridpointers[(int) RID_STATIC], NULL_TREE);
- #else
-   sc_spec = tree_cons (NULL_TREE, ridpointers[(int) RID_EXTERN], NULL_TREE);
- #endif
    ret_spec = TREE_PURPOSE (TREE_TYPE (method));
    decl_specs = chainon (sc_spec, ret_spec);
  
--- 7119,7125 ----

To build Swarm using such a modified GCC, run `make' like so:

  $ make EXTRACPPFLAGS=-DMETHOD_FUNCTIONS

In addition, using the Swarm patch below, you can improve the performance of
Java models which make many calls on Swarm, e.g. calling the random
number generator, Tk graphics routines, etc.  This patch requires a
GCC as modified above.

Index: interface.el
===================================================================
RCS file: /cvs/hive/Swarm/swarm/etc/interface.el,v
retrieving revision 1.30
diff -c -r1.30 interface.el
*** interface.el        2001/04/19 02:59:07     1.30
--- interface.el        2001/07/06 23:08:57
***************
*** 625,631 ****
      
  (defun create-dispatch-hash-table (protocol phase)
    (let ((ht (make-hash-table)))
!     ;(load-dispatch-hash-table protocol phase ht)
      ht))
    
  (defun c-objc-type (type)
--- 625,631 ----
      
  (defun create-dispatch-hash-table (protocol phase)
    (let ((ht (make-hash-table)))
!     (load-dispatch-hash-table protocol phase ht)
      ht))
    
  (defun c-objc-type (type)

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