From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Elpa: Pinpoint semantics of `seq-subseq' for streams Date: Thu, 15 Sep 2016 23:07:17 +0200 Message-ID: <87sht0an3u.fsf@web.de> References: <87bmzrahvg.fsf@web.de> <79c6ccd6-9808-f4fd-071a-58559f72ecdc@gmail.com> <8737l3a4ab.fsf@web.de> <27962aa1-ae40-99f8-64ad-ae21012fb36e@gmail.com> <87vaxywmh9.fsf@web.de> <49083306-0193-3bb0-74cc-ecac6e2d6022@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1473973668 21460 195.159.176.226 (15 Sep 2016 21:07:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Sep 2016 21:07:48 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: John Mastro , emacs-devel To: =?utf-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 15 23:07:44 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkdsd-00046x-FM for ged-emacs-devel@m.gmane.org; Thu, 15 Sep 2016 23:07:35 +0200 Original-Received: from localhost ([::1]:37391 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkdsb-0004cu-Ds for ged-emacs-devel@m.gmane.org; Thu, 15 Sep 2016 17:07:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkdsU-0004cn-DC for emacs-devel@gnu.org; Thu, 15 Sep 2016 17:07:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkdsQ-0006Jq-82 for emacs-devel@gnu.org; Thu, 15 Sep 2016 17:07:25 -0400 Original-Received: from mout.web.de ([212.227.15.14]:62278) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkdsP-0006JP-Tu for emacs-devel@gnu.org; Thu, 15 Sep 2016 17:07:22 -0400 Original-Received: from drachen.dragon ([90.186.1.83]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0LxOF0-1avkMP3QyY-01719g; Thu, 15 Sep 2016 23:07:20 +0200 In-Reply-To: <49083306-0193-3bb0-74cc-ecac6e2d6022@gmail.com> (=?utf-8?Q?=22Cl=C3=A9ment?= Pit--Claudel"'s message of "Wed, 14 Sep 2016 22:00:19 -0400") X-Provags-ID: V03:K0:AhsWYPMTKtiIbHRwmA5AvtAGPVAjbFGOgzEJ+9dBMSe3EDI3NaL DXpgoFn8gL0BrGX/5zEbTuTOipj+/nTOTiyJwSgF6P1+JHKvgNkcFDvMb+Jd+Mgmke+JycO ZSOFs8u1J2/GGy7/+Afh6pToApde7jFy3aGJ3OUaUr0BGJ/pbYAfxO4MJ0C7B3cIoHgf6Xd CJXJeG796JDampW5gQEVw== X-UI-Out-Filterresults: notjunk:1;V01:K0:g8HErwdZ37M=:de+M0xjmQ+7LTJKm+PNqI3 FqH8nYCuTAqM0jlTSM4v5WvibAhM7etxDIhXZUaYH6aRQzAd5tEZc9uypr1qpTaDs9vRcWvwj zdkDk2ZLIJmgg4mh8HFafyQekPETmGsMA5Ls02IQftv/aizMADdOfvn3M8iwhkcLMAPpExsq4 UoQG04yVJJbXF/JDdh3iIVPlO3n7CBtuD2o6zcTscS4sYbuOfqY2MFC6rNYPfKeZ3dVdVrVDu rzDgUK1NSPuvP/2lhF6/iMdjRnqCNZgY9ujBJ3NIL0kj6KqM8/jfiT0j41ap5Z+gt78G1e6n3 92MSy0jXZAFOsJo3vUmwuboF489a2va/iWuS2VQ3AWJbAzUFQ/wu7K1yHiBIehNvK+RIxavBk avj7Obe23F2omOoCGs+ec3Ba1D8uej1Ru1UYMPZ3Ru5wKTRRMmpCp4duUhdzuzo/uZA1xVGLK MYIrnnZ3R2Q2xcuzIc5CWeGYzfsOyXJA7gJnvMi1Ooku6LxSHYX9j7/sqCiSPYhzoetukzcga sCZGOYErpJFefA39bL3KX1VsAVLtKv0hijoRYOT4i+wY6HPAdQ0pqiMTZyix0RpX7ANVIPLEV +SLbdZ8S0DAYXkJ71WE6RZT5b4UR4RzAQ3wFkasCgYp9KHXrxxguUvzggQh0EooTY+LwmIAtJ /GkFh3z1HjthG2P8hCbqx51uGfq1dm0YSQUgiTfuWb3SgsD8aeVG7uRhPyWT/kGsp1Q0bIPDU OYWlSi8KEXndsHI/eP/xf024CdmpdyVRSE1u9BffoD1wfItmvGWwPzfjJe2ilKueiEu3oBIR X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.14 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:207449 Archived-At: Cl=C3=A9ment Pit--Claudel writes: > > but the same applies to a list. > > Not exactly: the list needs to be fully built before you iterate over > it. That's when the memory problems occur. So yes, during iteration > you can discard the cons cells that you've already seen in both cases, > but in the list case these cells need to all be constructed and kept > in memory beforehand. But I think what John said is still a valid argument: If you construct a stream of lines of a process's output (just for example), of, say, 10000 lines, you create 10000 new objects (strings), and you discard 10000 - n of them. They all need to be garbage collected. This will not only take a large amount of time - garbage collection happens not all the time, so memory will be filled to a certain amount as well. But I think the impact of garbage collection of that many objects is a more serious problem than memory usage anyway. Instead, a simple loop incrementing a position variable or something like that might be more appropriate (efficient). Michael.