all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Clément Pit--Claudel" <clement.pit@gmail.com>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: John Mastro <john.b.mastro@gmail.com>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: [PATCH] Elpa: Pinpoint semantics of `seq-subseq' for streams
Date: Thu, 15 Sep 2016 18:18:19 -0400	[thread overview]
Message-ID: <b6a95523-21b1-0ed7-3993-fa05557e319a@gmail.com> (raw)
In-Reply-To: <87sht0an3u.fsf@web.de>


[-- Attachment #1.1: Type: text/plain, Size: 1728 bytes --]

On 2016-09-15 17:07, Michael Heerdegen wrote:
> Clément Pit--Claudel <clement.pit@gmail.com> 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 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, memory.  It's just a trade-off.

> Instead, a simple loop incrementing a position variable or something 
> like that might be more appropriate (efficient).

Sure, but again: how is this related to lists vs strings? Lists need to be 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 not the right solution for a given problem? I agree fully :)

Cheers,
Clément.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-09-15 22:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13 16:23 [PATCH] Elpa: Pinpoint semantics of `seq-subseq' for streams Michael Heerdegen
2016-09-13 18:02 ` Clément Pit--Claudel
2016-09-13 21:17   ` Michael Heerdegen
2016-09-14  1:24     ` Clément Pit--Claudel
2016-09-14 15:05       ` Michael Heerdegen
2016-09-14 23:26         ` Clément Pit--Claudel
2016-09-15  0:51           ` John Mastro
2016-09-15  2:00             ` Clément Pit--Claudel
2016-09-15 17:01               ` John Mastro
2016-09-15 21:07               ` Michael Heerdegen
2016-09-15 22:18                 ` Clément Pit--Claudel [this message]
2016-09-15 22:28                   ` Michael Heerdegen
2016-09-15 22:52                     ` Clément Pit--Claudel
2016-09-15  0:58           ` Michael Heerdegen
2016-09-15  3:47             ` Clément Pit--Claudel
2016-09-15  8:42               ` Nicolas Petton
2016-09-15 22:30                 ` Michael Heerdegen
2016-09-15 23:08                   ` Nicolas Petton
2016-09-15 21:29               ` Michael Heerdegen
2016-09-14  1:28     ` John Wiegley
2016-09-14 15:15       ` Michael Heerdegen
2016-09-13 22:20 ` Nicolas Petton
2016-09-13 22:40   ` Michael Heerdegen
2016-09-14  8:25     ` Nicolas Petton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b6a95523-21b1-0ed7-3993-fa05557e319a@gmail.com \
    --to=clement.pit@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=john.b.mastro@gmail.com \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.