[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Performance optimization (allocation inside a for loop)

From: Francesco Potorti`
Subject: Re: Performance optimization (allocation inside a for loop)
Date: Tue, 07 Apr 2009 15:48:47 +0200

>I gave the idea a second thought - maybe it has some merits. Sometimes
>you really want to use an array as a stack in Octave to avoid going
>through a loop twice, so Octave can try to optimize such usage.

Two thoughts only:

 1) if stack operations are one target of this optimisation, then it
    would better to have a hysteresis behaviour, that is, deallocate
    one chunk only when the free space is 2*chunk big; more generally,
    deallocate so that at least a whole unused chunk remains unused

 2) 1kB for chunk size is very little today.  I would have considered
    one memory page size at least, but since marginal improvements are
    smaller for big chunks, maybe the current choice is good.  Only a
    benchmark can tell, I suppose.

Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: address@hidden
(entrance 20, 1st floor, room C71)     Web:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]