[mercury-users] Hints on Optimisation
Ralph Becket
rbeck at microsoft.com
Thu Oct 7 23:32:59 AEST 1999
I've read the papers that describe the various optimisations carried out
by the compiler, but it's not clear to me when or how deeply they are
applied. I wonder if there are a few rules of thumb that could be used
to help the programmer decide when a particular piece of code is optimal,
wrt the compiler, or what the tradeoffs are when coding up an inner loop,
say.
For example, one thing I frequently want to do is wrap bits of `state' up
in some ADT, which typically means having something like a type with a
single constructor with a number of fields. What is a good heuristic for
guessing when the compiler will `unbox' an instance of the ADT so one
can `update' the fields of the instance without creating a new boxed version
on the heap? I'm sure I can think of several other optimisations that I'm
unsure as to when and where they apply.
Cheers,
Ralph
--------------------------------------------------------------------------
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