From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Elpa: Pinpoint semantics of `seq-subseq' for streams Date: Thu, 15 Sep 2016 18:18:19 -0400 Message-ID: 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> <87sht0an3u.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LBm0p4XX6MObffbGOD3t2J29mnbujfptC" X-Trace: blaine.gmane.org 1473978012 5194 195.159.176.226 (15 Sep 2016 22:20:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Sep 2016 22:20:12 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 Cc: John Mastro , emacs-devel To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 16 00:20:07 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 1bkf0k-0000Qn-4p for ged-emacs-devel@m.gmane.org; Fri, 16 Sep 2016 00:20:02 +0200 Original-Received: from localhost ([::1]:37696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkf0h-0007q9-SC for ged-emacs-devel@m.gmane.org; Thu, 15 Sep 2016 18:19:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkezf-0007nd-KQ for emacs-devel@gnu.org; Thu, 15 Sep 2016 18:18:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkezb-0004qQ-AY for emacs-devel@gnu.org; Thu, 15 Sep 2016 18:18:54 -0400 Original-Received: from mout.kundenserver.de ([212.227.126.133]:57532) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkeza-0004j8-SU for emacs-devel@gnu.org; Thu, 15 Sep 2016 18:18:51 -0400 Original-Received: from [18.26.2.123] ([18.26.2.123]) by mrelayeu.kundenserver.de (mreue004) with ESMTPSA (Nemesis) id 0MMrlb-1beIvb0V2d-008ZtX; Fri, 16 Sep 2016 00:18:28 +0200 In-Reply-To: <87sht0an3u.fsf@web.de> X-Provags-ID: V03:K0:GSY27RoQiDuvuGW4ehO00t0WZEMt4sFEmKoxxsQ4O2yX008iywd Yazv6cxyCjXkz5Jy6WsjXTb8XUZnLHkBbKfNOz5uWlPEdltjWykvxZIB9xSTmeKMVFtxQeV d/hgveJ+VH27wrcGGbAzZRMHiaDkcKcswplnA1U25JWY18KtLf+Og0PV49N4kHKi6hOVXoj oHp2pCy3sx0lAOyY9uXYg== X-UI-Out-Filterresults: notjunk:1;V01:K0:bWh1j91cBMA=:V6RJ0fwiTTOtXMaKhbnYlN rylc48Cd0N+akbWbEjcsI4KY73K4mCj/SYtT83d3XyEnduxg2k+Znf9IHXnlIGBvhsEg/ZYiV Saem9wtyFBdvRXsaCFp3+PJcjLKPLm6s4rnUICQkAF0bPAv1Oug93++hyVbskSXt6qKA3DdG+ mbfjzVE2Kh4K/jsylo3osIhNdo1QyHQ/d9wcoHiCJB5kGrA1PI5GjX73cGM+YF7e21O/VwAlS TGmVtvVAOBQ8DIc/33bB5H7lX8jKtjcS9Tk968fzj1TjyYWpqpGuaupT7vdFp6p/Iap943RYH AZdxtaV6qbYcbmEHPOz4BSDBZUvsAcD2IdEnOvirTP01SgA5YzWGeVeIGBCSVL0ZTuFp/SHOy mbemiIUbnPvHBPN1A4Sj9ABZr7so9TrLBy7JVaWf+NVSOuqp/0khWvGrU17z9BbgKP2MA817d sbH8WcAIVi65hMcm+qiuSqAkc1INp2Mw7+Ohtj/TFezhLAChRKd8ZGc6VvGD7slOYt5MP+xFS Z5pJzYxybpYKrQvJ4jZlvK7RXMrR1lpQSTnhqIcWr+ODyDfScMVrOLw9sik8q1XSqA91x2dj9 u/gnaOUWdeqUl5Ls0qsUCYwx2aGhwXSJPRJHFGsNkvQZYG3Qb9lAYb9c7hOib22m/jjLkPMHo N0cy7ErrmIJ7ORLmaymOqGqPs96RmAfMdSZZ2wJtAxYSZuEx45JxngR1EhYFd2N5HGg4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.133 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:207452 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --LBm0p4XX6MObffbGOD3t2J29mnbujfptC Content-Type: multipart/mixed; boundary="f1BBE6ESLoLDpXkGTsRX2IaBdJW6n2qDm"; protected-headers="v1" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: Michael Heerdegen Cc: John Mastro , emacs-devel Message-ID: Subject: Re: [PATCH] Elpa: Pinpoint semantics of `seq-subseq' for streams 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> <87sht0an3u.fsf@web.de> In-Reply-To: <87sht0an3u.fsf@web.de> --f1BBE6ESLoLDpXkGTsRX2IaBdJW6n2qDm Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016-09-15 17:07, Michael Heerdegen wrote: > Cl=C3=A9ment Pit--Claudel writes: >=20 >>> but the same applies to a list. >>=20 >> 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. >=20 > 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 is orthogonal to the list-vs-stream debate, isn't it? > 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. [citation needed] :) Garbage collection costs time; memory costs, well, m= emory. It's just a trade-off. > Instead, a simple loop incrementing a position variable or something=20 > like that might be more appropriate (efficient). Sure, but again: how is this related to lists vs strings? Lists need to b= e garbage collected just the same. > Instead, a simple loop incrementing a position variable or something > like that might be more appropriate (efficient). I'm not sure what you mean :\ Are you saying that sometime streams are no= t the right solution for a given problem? I agree fully :) Cheers, Cl=C3=A9ment. --f1BBE6ESLoLDpXkGTsRX2IaBdJW6n2qDm-- --LBm0p4XX6MObffbGOD3t2J29mnbujfptC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX2x4xAAoJEPqg+cTm90wjlkYP/2saIBMJ4PBNzQvGfPnKPSbN cUWDsMsqZhjsoWmIWaWPITF5I5eTJP/fsd8hcADaXKWkGo8gRDCWWzhlLHoCnIMS 7zMZhHe7aB4WHtQVMz1HxvMoC9pITIZLAG5k7ck7cm4rDho/eAZEzp/be76o3uWw D+9qoPkNze3fmztgF28g4GHudsZIPUCY71O8fdij6gs3nyFgC73TFFhyApaXG7rP iJIP2tqDcxYGcD1HMRvsUPCLkhtbwV53UVg5kcGO+GjyCr+dDq2up0iQeJnJ/Glj u0Je6DIUiFdW4Qz8hjhWxCip7gX9R8oJYuceZ0Wr1Bl5Anc2XpRsBU+ZtXpcGjD+ pXqX6E/oFTEFOMgBxVQQsM70gNc6ms2hVqYiuX2CLcEmla1STlyj1H3Cu0AUIKRe zsA/XmQyy7FpXw5aaJZ+baI6gkL3d87TwGX38QwuFuE9FqRA6AeqE1EMa1GF75rN TvuxdVnZIcuzjzacNiVEvydXh9LIlIl1v7DJ432O7nlugtsMjc6gGyEfJCjNSzij GJL22/adec/cMfTJ+kRsRobK7a6Q/vlw6Jfwm5RVfBCGuZ6rX3J1hP8QbOtN5wlC Fzt1hqtlCFuyxjzopazsus8EHmncQSX+fTbv8G8WAAAMwKOP4WrneyHEy0seE83D l1+EH38MOe61BNmhQ/YY =xldw -----END PGP SIGNATURE----- --LBm0p4XX6MObffbGOD3t2J29mnbujfptC--