| Howard Brazee 2005-07-25, 10:01 pm |
|
On 21-Jul-2005, "Chuck Stevens" <charles.stevens@unisys.com> wrote:
> It is not clear to me that making the particular piece of code smaller by
> eliminating some in-line code and putting it into another piece of code will
> always make it run faster. It seems to me that a "branch-and-link" or
> other PERFORM analog to a sequence of machine instructions will ordinarily
> run a little *slower* than the same sequence of machine instructions
> executed linearly within the larger sequence. Maybe I don't understand what
> it is you're trying to convey.
Sometimes compilers for supercomputers actually take code and make multiple
copies - which are executed simultaneously.
But those computers are designed to avoid virtual memory swaps as much as
possible.
> Why should object code *ever* need to be paged *out*, since code can never
> be modified in memory anyway?
VM machines have various degrees of smarts and successes. The easiest thing to
do is to swap a whole program out when memory is needed by another program.
But if it has control over various modules, it can be smarter about just
swapping out enough modules to free up the required amount of memory. On the
other hand - if it picks the small modules to swap out - programs with small
modules will be the ones that are slowed down when this happens.
|