[m-dev.] efficiency of collect
Fergus Henderson
fjh at cs.mu.OZ.AU
Wed Nov 3 18:04:42 AEDT 1999
On 26-Oct-1999, Erwan Jahier <Erwan.Jahier at irisa.fr> wrote:
> BTW, I have a question. Since such calls are done for each event (i.e. possibly
> millions of times), the cheaper those calls are, the better. Do you think there
> exist a cheaper way of doing those calls?
>
> For example, do you think it would be possible to avoid to save and restore the
> registers (I mean, what MR_TRACE_CALL_MERCURY does) all the time?
Well, if/when the THREAD_SAFE mode works, you could run the `collect'
calls in a different MercuryEngine; then they would have their own
set of registers, their own stacks, and their own heap.
In THREAD_SAFE mode, the engine structure is normally accessed
via a pointer in a register, so switching engines would be quite
cheap, you'd just need to change that register to point to
the new engine. You wouldn't need to save and restore all the
fake_reg array, and the MR_make_permanent() call would not be needed either.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list