For the last few releases of Maple, we have been adding features to take advantage of multi-core processors.  Most of this work has focused on particular algorithms or on tools that allow users to author their own parallel code.  Although this was very useful for those users who were able to use those tools, many users did not see a performance improvement.  To help all users we need to integrate parallelism into the core algorithms of Maple.  In Maple 17 we have taken the first step towards general parallelism in the core algorithms by implementing a parallel garbage collector.

The garbage collector is an algorithm that handles Maple's memory usage.  It allows Maple to track and reuse memory when it is no longer in use.  To do this, the collector runs periodically and scans the memory that Maple has allocated looking for memory that can be reclaimed.  This process occurs whenever non-trivial Maple code is run, so by parallelizing the garbage collector all Maple users will see some performance benefits.

The following, very artifical example, shows the effect of parallelism on just the garbage collector.

data := [seq(i, i = 1 .. upperBound)]:
p := proc()
    local i;
    for i to 100 
    end do 
end proc;

kernelopts(gcmaxthreads = 1):
t1[1] := time[real](p());

kernelopts(gcmaxthreads = 2):
t1[2] := time[real](p());

kernelopts(gcmaxthreads = 4):
t1[4] := time[real](p());

For real examples the garbage collector is usually responsible for 5-20% of the total running time, although in some bad situations it can take up to 50%.  Thus in general, we'd expect a speed up of about 5-10%.  Although this is not a huge speed up, it should be a speed up that helps most of our users.


-- Kernel Developer Maplesoft

Please Wait...