On Fri, Apr 3, 2020 at 8:26 AM Paul Sokolovsky <pmis...@gmail.com> wrote:
>
> Hello,
>
> On Wed, 1 Apr 2020 21:25:46 -0400
> Kyle Stanley <aeros...@gmail.com> wrote:
>
> > Also, on the point of memory usage: I'd very much like to see some
> > real side-by-side comparisons of the ``''.join(parts)`` memory usage
> > across Python implementations compared to ``StringIO.write()``. I
> > some earlier in the thread, but the results were inaccurate since
> > they relied entirely on ``sys.getsizeof()``, as mentioned earlier.
> > IMO, having accurate memory benchmarks is critical to this proposal.
> > As Chris Angelico mentioned, this can be observed through monitoring
> > the before and after RSS (or equivalent on platforms without it). On
>
> I would still find that too crude an approach. If it would come to
> that, I would prefer to actually study internal implementation(s) in
> detail, and patch up sys.getsizeof() to provide actual information.

But it's actually accurate. With getsizeof, you're trying to gauge how
much memory something consumes, but it can't acknowledge certain types
of memory savings, nor can it recognize certain types of memory
consumption. By asking your operating system how much memory you're
using, you guarantee to see the actual figure. OTOH, this only works
for fairly large allocations, but then again, if the memory cost
doesn't actually impact the RSS, is it really a cost?

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/TD444OBITQHWFVJER7DMSYIGWOZ35ZGR/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to