[mercury-users] Possum

Dan Hazel d.hazel at mailbox.uq.edu.au
Mon Sep 20 19:59:49 AEST 1999


Fergus Henderson writes:
 > On 20-Sep-1999, Dan Hazel <d.hazel at mailbox.uq.edu.au> wrote:
 > > 
 > > looking a little harder.  This is because the Solaris version is
 > > much much slower.  Any ideas as to why this might be (without 
 > > having seen the code :-) ?
 > 
 > Hmm...  that's a tough one.
 > 
 > I can only guess.  Perhaps you are doing lots of calls from C to
 > Mercury in your inner loop?  Currenty each call from C to Mercury does
 > a setjmp() and longjmp() and on Solaris I think setjmp()/longjmp() are
 > quite inefficient because longjmp() does a system call to restore the
 > signal mask.  _If_ that is the cause, then the solution would be to
 > replace the calls to setjmp()/longjmp() in runtime/mercury_engine.c
 > with calls to _setjmp()/_longjmp().
 > 
 > You could try using the Mercury profiler and/or the `strace' utility
 > to see where the time is being spent.
 > 

I'm not doing any calls from C to Mercury though so unless there are lots of 
calls from C to Mercury in the libraries (in particular the map
module?) you might not be guessing the problem.  I mention map
since the profiling I've done (on Linux) has shown the time is spent
in Possum's unify/dereference and the heart of the Z variable "heap"
is a Mercury map (I've tried other ADTs over the years but have always 
returned to map).

I guess I'd hoped there was some known problem with Mercury on Solaris.
For example the Linux/Solaris speed ratio seems to be about the same
for compiling Possum as it is for answering a runtime Possum query.
You'd think the Linux machine was about 4 times faster.  It's not
by the way.

Thanks anyway.
Dan Hazel
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list