Gnus development mailing list
 help / color / mirror / Atom feed
From: Ken Raeburn <raeburn@cygnus.com>
Cc: ding@ifi.uio.no
Subject: Re: [ patch ] async stuff fix(?) (was Re: 0.3 and async pre-fetch)
Date: 05 Aug 1996 14:20:53 -0400	[thread overview]
Message-ID: <tx1spa1snei.fsf@cygnus.com> (raw)
In-Reply-To: Sudish Joseph's message of 04 Aug 1996 18:09:51 -0400


Sudish Joseph <sudish@mindspring.com> writes:

> The downside to using strings is that we'll get -large- strings that
> will hog memory until garbage collection.

I think that'll be bad for performance.  Remember emacs does gc
roughly after each N bytes allocated.  So if you get a large string
per article, say, you'll be doing gc very often as you go through one
newsgroup.  (Just building a summary buffer for 1000 articles causes
me to run gc several times.  That's part of the reason for the
simplified-subject-caching speedups I sent mail about a while back.
At some point interning in a symbol table once is cheaper than
regenerating multiple copies of the same strings over and over.)

Also, the cost of doing a gc is, I think, dependent on the currently
allocated storage and the max-so-far allocated storage.  (Has anyone
looked at it more closely?  I think only buffers are allocated from
storage that can get freed, but I could be wrong.)  So allocating big
strings that can't be gc'ed right away means the price of future gc
passes probably goes up.

Can you return articles or other big stuff as buffers or buffer
portions?  (Carefully arranging to always have them cleaned up, of
course.)

>	  Is there any way to
> truncate the actual string to get around this?  (It has to be there,
> I'm too lazy to dig right now.)  Even better, any way to totally
> obliterate the in-memory string; i.e., gc a single string?

None I know of.

>	  I don't
> think the number of actual strings generated will increase gc costs.
> If so, we might keep a constant number of strings that we grow and
> truncate as needed.  Hmm, do buffers cost more/less than strings?  We
> might pass buffers as our result from the filter if that's better.
> Buffers aren't gc'ed I think, but we can manually maintain those quite
> easily.

A buffer should be more expensive than a string, but passing around
lots of mark in a single buffer may be cheaper than manipulating lots
of substrings.  The buffer contents don't go through the alloc/gc
interface that strings and other objects use.

> PS:  If anyone would care to explain: can buffers be gc'ed?  are
> lambda's gc'ed (if not, gnus currently leaks)?  can an arbitrary
> object be completely destroyed/gc'ed all by itself?

I think you have to explicitly kill buffers first; yes; no.


  parent reply	other threads:[~1996-08-05 18:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-01 23:41 0.3 and async pre-fetch Sudish Joseph
1996-08-02  1:31 ` 0.3 and async pre-fetch (and YA bug report) Raja R Harinath
1996-08-02 17:35 ` 0.3 and async pre-fetch Lars Magne Ingebrigtsen
1996-08-03  0:35   ` Sudish Joseph
1996-08-04 22:09     ` [ patch ] async stuff fix(?) (was Re: 0.3 and async pre-fetch) Sudish Joseph
1996-08-05  0:39       ` Sudish Joseph
1996-08-05 17:11       ` Lars Magne Ingebrigtsen
1996-08-06  6:08         ` Sudish Joseph
1996-08-06 20:51           ` Lars Magne Ingebrigtsen
1996-08-05 18:20       ` Ken Raeburn [this message]
1996-08-05 17:00     ` 0.3 and async pre-fetch Lars Magne Ingebrigtsen

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=tx1spa1snei.fsf@cygnus.com \
    --to=raeburn@cygnus.com \
    --cc=ding@ifi.uio.no \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).