swarm-support
[Top][All Lists]
Advanced

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

Re: profiling


From: Marcus G. Daniels
Subject: Re: profiling
Date: Wed, 29 Jan 2003 17:25:14 -0700
User-agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.3b) Gecko/20030117

Rick Riolo wrote:

So what is your favorite profiling tool for objectiveC-Swarm? For Java-Swarm?
(free ones being preferred, of course...)

For Objective C or Java, you'll get the best results by first compiling Swarm, and ideally all dependent libraries, with profiling. Configure with:

  CC="gcc -pg" ./configure [etc]

When that is installed, compile your Objective C model. You should see the "-pg" propagated to the compiler as your model is compiled.

You may also want to link your model statically, to reduce indirect startup costs:

 make EXTRALDFLAGS=-static

Then run your model and end it in a way it exists cleanly (don't interrupt it). If you can run it in batch, that's better, as you won't have GUI costs cluttering things.
You may then profile it:

 gprof your-executable > output

And look at `output'. The first part is which functions (Objective C methods end up being functions too) take the most time.

Often with Swarm you'll see that objc_msg_lookup dominates. That means most of the time is spent sending messages. The second part of the output "Call graph" will show you the call patern regions that as a chunk take up lots of time.

Profiling Java is easy, just add "-prof" or "-Xrunhprof" to the java or javaswarm command line. The numbers you get won't be as complete as with -pg profiling, but they are usually sufficient.

For really nasty performance problems I li have used gcj with success (the Java front end of GCC), and compile the model with -pg, the Swarm Java stubs with -pg, and Swarm with -pg.

After that, there is a deeper level of information that is harder to get. The information about how well the system hardware caches, brance prediction, etc. are doing. In other words, how well your software abstraction maps onto the hardware (not in terms of correctness, but in terms of exploiting the available fast cache memory on the CPU). For that you either need to use a commercial tool like Intel's Vtune or a cache simulator like valgrind. Vtune uses built-in counters in the Pentium to monitor the execution efficiency of running code.


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