Deamortizing AA's and Dynamic Arrays

0ffh spam at frankhirsch.net
Mon Apr 23 22:26:12 PDT 2007


Derek Parnell wrote:
> On Mon, 23 Apr 2007 22:14:46 +0200, 0ffh wrote:
> In that case, Manfred probably used the term "Amortizing" rather than
> "De-Amortizing". To me, the 'de-' prefix implies an operation that reverses
> the effect of amortizing the behaviour. In other words, 'de-amortizing'
> means bunching up the costs into larger lumps and 'amortizing' means
> spreading the costs into smaller lumps. In both case, the lumps would be
> predictable rather than probabilistically determined.

I'm not 100% sure here how the language should be used.
My interpretation runs thus:

"Amortising" is just a mathematical "trick" to make different sorts of
algorithms comparable in terms of computational cost per function call,
by spreading lumped costs equally over all calls.
Therefore, I interpret "deamortising" a piece of /concrete code/ as
removing the need for this "spreading trick" by replacing a "lumpy"
method with a more "incremental" one.

Regards, Frank



More information about the Digitalmars-d mailing list