all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Antipov <dmantipov@yandex.ru>
To: Emacs development discussions <emacs-devel@gnu.org>
Cc: Stefan Monnier <monnier@IRO.UMontreal.CA>
Subject: Re: [Emacs-diffs] trunk r114117: * buffer.c (drop_overlay):
Date: Sat, 07 Sep 2013 08:37:14 +0400	[thread overview]
Message-ID: <522AAD7A.3030502@yandex.ru> (raw)
In-Reply-To: <jwvhae1emmw.fsf-monnier+emacs@gnu.org>

[This is from private e-mail to Stefan due to:
  <monnier@IRO.UMontreal.CA>: connect to
  pinpin.IRO.UMontreal.CA[132.204.24.52]:25: Connection timed out]

On 09/03/2013 11:25 PM, Stefan Monnier wrote:

> Thinking about optimizing markers.
> How 'bout changing unchain_markers so it is constant time: add a new
> "unchained" bit in the Lisp_Marker struct and set it to true there.
> Then reap those markers that are "unchained but still in the list"
> lazily, either during GC or when we traverse the list for some
> other reason, or when we really have to because the marker is being
> re-chained elsewhere (but not if it's being rechained in the same
> buffer).

This looks good, and I'll try to implement this.

I'm also thinking about offloading GC with explicit marker freeing.
For example, save-excursion creates up to 2 markers each time, and
this is the well-known bottleneck because there may be thousands
calls to save-excursion per just one basic editing command in cc-mode.
But we can't use free_marker instead of unchain_marker
in save_excursion_restore because the marker may be recorded in
buffer undo list, and freeing it creates dangling pointer (I hit
this problem in r109221, and the latter was immediately reverted :-().
So I suppose that we need one more bit for internal temporary
markers that are invisible to Lisp and presumably have short lifetime -
such a markers should not be included in undo lists and so can be
safely freed when they're not needed anymore.

Dmitry



       reply	other threads:[~2013-09-07  4:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1VGrmg-0000c9-Jm@vcs.savannah.gnu.org>
     [not found] ` <jwvhae1emmw.fsf-monnier+emacs@gnu.org>
2013-09-07  4:37   ` Dmitry Antipov [this message]
2013-09-09 19:41     ` [Emacs-diffs] trunk r114117: * buffer.c (drop_overlay): Stefan Monnier

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=522AAD7A.3030502@yandex.ru \
    --to=dmantipov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /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.