monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] using empty() instead of size()


From: Eric Anderson
Subject: Re: [Monotone-devel] using empty() instead of size()
Date: Tue, 23 Sep 2008 16:12:53 -0700

Zack Weinberg writes:
 > On Mon, Sep 22, 2008 at 3:09 PM, Markus Wanner <address@hidden> wrote:
 > > This leads me to think that the STL implementation doesn't provide an O(1)
 > > implementation for size()... savings is avg memory consumption seems to
 > > confirm this, no?
 > 
 > Now that's just bloody weird.  I can't think of any reason size()
 > would need to *allocate memory*.

Assuming that the code for getting memory usage is derived from the
code I wrote a long time ago (output looks similar, so likely); I
expect that the memory consumption differences are just sampling
effects.  It sampled every 1 second or so, and so changes to runtime
can affect when the memory usage is sampled and hence the estimated
memory usage.  Tools like valgrind in it's massif mode will give you
better memory usage comparisons, but result in big slowdowns.
        -Eric





reply via email to

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