Re: realloc() - frequency, conditions, or experiences about relocation?

Liste des GroupesRevenir à ss math 
Sujet : Re: realloc() - frequency, conditions, or experiences about relocation?
De : anton.txt (at) *nospam* gmail.moc (Anton Shepelev)
Groupes : comp.lang.c sci.stat.math
Date : 20. Jun 2024, 00:53:47
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240620015347.9bdcc4df03ab63d096375450@gmail.moc>
References : 1 2 3 4 5 6 7 8
User-Agent : Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Malcolm McLean:

We have to have some knowledge. And what we probaby know
is that the input is a file stored on someone's personal
computer. And someone has published on the statistical
distribution of such files And they have a log-normal
distribution with a mean and a median which he gives. So
with that informaton, we can work out, given that a file
is at least N characters, what is the prbablity that an
allocation of any size will contain the whole file, and
how many bytes, on average will be wasted.

Observe that the standard algorithm of exponential growth is
memoryless and self-similar in that in does not depend on
context, or the history of previous reallocations.  These
properties belong to (or even identify?) the exponential
distribution.  We can therefore assume that exponential-
growth strategy is ideal for exponentially distributed
buffer sizes, and under that assumption determine the
relation between the CDF values (p) corresponding to
consequent re-allcoations:

   p  = e^x/L                 ,
   p0 = 1-e^(L*x0)            ,
   p1 = 1-e^(L*x1)            ,
   x1 = k*x0 (by our strategy), =>
   p1 = 1-(1-p0)^k            .

which does not depend on the distribution and lets us
generalise this approach for any distribution:

              x1 = Q( 1 - ( 1 - CDF(x0) )^k )

where:

   x0    : the required size
   x1    : the new recommended capacity
   Q(p)  : the p-Quantile of the given distribution
   CDF(x): the CDF of the given distribution
   k>1   : balance between speed and space efficiency

--
()  ascii ribbon campaign -- against html e-mail
/\  www.asciiribbon.org   -- against proprietary attachments

Date Sujet#  Auteur
17 Jun 24 * Re: realloc() - frequency, conditions, or experiences about relocation?22Anton Shepelev
18 Jun 24 +- Re: realloc() - frequency, conditions, or experiences about relocation?1David Jones
19 Jun 24 +* Re: realloc() - frequency, conditions, or experiences about relocation?8David Duffy
19 Jun 24 i+* Re: realloc() - frequency, conditions, or experiences about relocation?6Malcolm McLean
19 Jun 24 ii+* Re: realloc() - frequency, conditions, or experiences about relocation?3Ben Bacarisse
19 Jun 24 iii`* Re: realloc() - frequency, conditions, or experiences about relocation?2David Brown
19 Jun 24 iii `- Re: realloc() - frequency, conditions, or experiences about relocation?1Ben Bacarisse
20 Jun 24 ii`* Re: realloc() - frequency, conditions, or experiences about relocation?2Anton Shepelev
8 Jul 24 ii `- Re: realloc() - frequency, conditions, or experiences about relocation?1Anton Shepelev
19 Jun 24 i`- Re: realloc() - frequency, conditions, or experiences about relocation?1Anton Shepelev
2 Jul 24 `* Re: realloc() - frequency, conditions, or experiences about relocation?12Rich Ulrich
2 Jul 24  +* Re: realloc() - frequency, conditions, or experiences about relocation?5Keith Thompson
2 Jul 24  i`* Re: realloc() - frequency, conditions, or experiences about relocation?4Rich Ulrich
8 Jul 24  i `* Re: realloc() - frequency, conditions, or experiences about relocation?3Anton Shepelev
22 Jul 24  i  `* Re: realloc() - frequency, conditions, or experiences about relocation?2Rich Ulrich
23 Jul 24  i   `- Re: realloc() - frequency, conditions, or experiences about relocation?1Anton Shepelev
2 Jul 24  `* Re: realloc() - frequency, conditions, or experiences about relocation?6Paul
2 Jul 24   `* Re: realloc() - frequency, conditions, or experiences about relocation?5Rich Ulrich
2 Jul 24    `* Re: realloc() - frequency, conditions, or experiences about relocation?4Rich Ulrich
2 Jul 24     `* Re: realloc() - frequency, conditions, or experiences about relocation?3Paul
2 Jul 24      +- Re: realloc() - frequency, conditions, or experiences about relocation?1James Kuyper
2 Jul 24      `- Re: realloc() - frequency, conditions, or experiences about relocation?1James Kuyper

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal