Hi,
Two comments on your performance issues with Fib.x10
1.
Looking at your Fib code, I see you are still allocating objects on the
sequential leafs of your computation.
For r small you really want to compute Fib with something like:
static def seq(r:Int) {
if (r < 2) return 0;
return seq(r-1) + seq(r-2);
}
with no Fib object allocated.
Otherwise, you rapidly exhaust the thread-local memory pool.
If you do, GC synchronization costs across threads prevent scaling.
2.
You need a much larger small n than 12. Say 30.
Or better you want to dynamically decide whether to compute Fib
sequentially using the following helper method from the x10.lang.Runtime
class.
/**
* The amount of unscheduled activities currently available to this
worker thread.
* Intended for use in heuristics that control async spawning
* based on the current amount of surplus work.
*/
public static def surplusActivityCount():int;
If this method return a large number (say >= 3) then you want to go
sequential, otherwise you should use the finish/async pattern.
Olivier
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
X10-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/x10-users