Re: Method Level optimizations.

Stefan Monnier <>
Tue, 31 Jan 1995 18:58:08 GMT

          From comp.compilers

Related articles
Method Level optimizations. (Charles Fiterman) (1995-01-23)
Re: Method Level optimizations. (1995-01-27)
Re: Method Level optimizations. (Stefan Monnier) (1995-01-31)
| List of all articles for this month |

Newsgroups: comp.compilers
From: Stefan Monnier <>
Keywords: OOP, optimize
Organization: Ecole Polytechnique Federale de Lausanne
References: 95-01-044
Date: Tue, 31 Jan 1995 18:58:08 GMT

Charles Fiterman <> wrote:
] Consider the advantages of optimizing away A *= unity; Where

It's probably possible to already do this kind of optimisation:
There might be some problems in the specific case you provide, but
imagine a language with multimethods And the above code rewritten into

A = A * unity

If unity is a subtype of matrix and if you only have one
multiplication defined with unity as the second parameter, then the
method call is known statically and can be inlined and optimised away.
(since the corresponding code would be very simple like:
method * ( <matrix> A , <unity> B) = A)

In general subtying can be a good help for optimisation if the method
call isn't too expensive, which is the case if the types are
statically known, allowing the method lookup to be done at
compile-time !


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.