[Top][All Lists]
[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
- Re: [Monotone-devel] using empty() instead of size(), (continued)
- Re: [Monotone-devel] using empty() instead of size(), Markus Wanner, 2008/09/22
- Re: [Monotone-devel] using empty() instead of size(), Zack Weinberg, 2008/09/22
- Re: [Monotone-devel] using empty() instead of size(), Derek Scherger, 2008/09/22
- [Monotone-devel] Re: using empty() instead of size(), Bruce Stephens, 2008/09/23
- Re: [Monotone-devel] Re: using empty() instead of size(), Ulf Ochsenfahrt, 2008/09/23
- Re: [Monotone-devel] Re: using empty() instead of size(), Bruce Stephens, 2008/09/23
- Re: [Monotone-devel] Re: using empty() instead of size(), Ulf Ochsenfahrt, 2008/09/23
- [Monotone-devel] Re: using empty() instead of size(), Bruce Stephens, 2008/09/23
- Re: [Monotone-devel] Re: using empty() instead of size(), Ulf Ochsenfahrt, 2008/09/23
- Re: [Monotone-devel] using empty() instead of size(), Markus Wanner, 2008/09/23
- Re: [Monotone-devel] using empty() instead of size(),
Eric Anderson <=
- Re: [Monotone-devel] using empty() instead of size(), Markus Wanner, 2008/09/24
- Re: [Monotone-devel] using empty() instead of size(), Eric Anderson, 2008/09/24
- Re: [Monotone-devel] using empty() instead of size(), Stephen Leake, 2008/09/23
- Re: [Monotone-devel] using empty() instead of size(), Markus Wanner, 2008/09/23
- Re: [Monotone-devel] using empty() instead of size(), Stephen Leake, 2008/09/23
- Re: [Monotone-devel] using empty() instead of size(), Markus Wanner, 2008/09/24
Re: [Monotone-devel] using empty() instead of size(), Jens Finkhäuser, 2008/09/22