unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@protonmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Ihor Radchenko <yantar92@posteo.net>, emacs-devel@gnu.org
Subject: Re: Markers in a gap array
Date: Thu, 04 Jul 2024 20:34:00 +0000	[thread overview]
Message-ID: <dfJE6JR_EIS55b5yYx-PajGk5L_q5N9QyzB7X-oD2HbK6e8EO2iJs2CF8xv-DFLMpatiulXVHdMul0D25KaVbyVd6MUy78DDWD9iaZGUhZg=@protonmail.com> (raw)
In-Reply-To: <jwvzfqx0wde.fsf-monnier+emacs@gnu.org>

On Thursday, July 4th, 2024 at 20:11, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> Ihor Radchenko [2024-07-04 14:30:47] wrote:
> > Stefan Monnier monnier@iro.umontreal.ca writes:
> > 
> > > > Some perf stats:
> > > > 
> > > > ;; Switch to todo and mark next 3 times, on branch
> > > > ;; 28.72% emacs emacs
> > > > [.] markers_sanity_check
> > > 
> > > Did you build with or without assertions?
> > 
> > Without.
> > 
> > > And indeed, I need to rework them to be "more conditional" (but I was
> > > focused on correctness until now). You should probably remove those
> > > calls to `markers_sanity_check` by hand when testing performance, sorry.
> > 
> > Without these calls, I can see some speed improvement in
> > buf_bytepos_to_charpos, but I do not currently have a reliable
> > reproducer to trigger buf_bytepos_to_charpos slowdown on master, so it
> > is comparing very small numbers.
> 
> 
> Hmm... I tried a benchmark based on:
> 
> (defconst elb-bytechar-buffer
> (let ((buf (get-buffer-create " elb-bytechar")))
> (with-current-buffer buf
> (let ((step (apply #'concat "🙂 foo\n" (make-list 2000 "asdf "))))
> (dotimes (_ (/ 10000000 (length step)))
> (insert step))
> buf))))
> 
> (defconst elb-bytechar-re "\\<.\\> \\<.\\> bar")
> 
> 
> (defun elb-bytechar--aux (nmarkers lookup &optional marker-fun)
> (with-current-buffer elb-bytechar-buffer
> (let ((step (/ (buffer-size) nmarkers))
> (markers nil))
> (dotimes (i nmarkers)
> (push (copy-marker (funcall (or marker-fun #'identity) (* i step)))
> markers))
> (dotimes (_ 10)
> (goto-char (point-min))
> (let ((parse-sexp-lookup-properties lookup))
> (re-search-forward elb-bytechar-re nil t))))))
> 
> where I call `elb-bytechar--aux` with various arguments.

Could you share a more complete recipe for the benchmark? I wonder how it compares to Gerd's weak vector/freelist in scratch/igc.

I think this is very exciting, even though it might have been triggered by incorrectly-reported numbers of markers :-)

Pip



  reply	other threads:[~2024-07-04 20:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-04  4:59 Markers in a gap array Stefan Monnier
2024-07-04 10:24 ` Ihor Radchenko
2024-07-04 13:16   ` Stefan Monnier
2024-07-04 14:30     ` Ihor Radchenko
2024-07-04 20:11       ` Stefan Monnier
2024-07-04 20:34         ` Pip Cet [this message]
2024-07-04 20:42           ` Stefan Monnier
2024-07-17 16:48             ` Helmut Eller
2024-07-18 20:46               ` Stefan Monnier
2024-07-26 19:48                 ` Helmut Eller
2024-08-05 19:54                   ` MPS: marker-vector (was: Markers in a gap array) Helmut Eller
2024-08-05 21:14                     ` MPS: marker-vector Pip Cet
2024-08-06  6:28                       ` Helmut Eller
2024-08-06  6:51                         ` Gerd Möllmann
2024-08-06 14:36                         ` Pip Cet
2024-08-06 16:15                           ` Helmut Eller
2024-08-06  3:59                     ` Gerd Möllmann
2024-08-06  6:02                       ` Helmut Eller
2024-07-04 22:24         ` Markers in a gap array Stefan Monnier
2024-07-07 12:31         ` Ihor Radchenko
2024-07-07 13:09         ` Konstantin Kharlamov

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='dfJE6JR_EIS55b5yYx-PajGk5L_q5N9QyzB7X-oD2HbK6e8EO2iJs2CF8xv-DFLMpatiulXVHdMul0D25KaVbyVd6MUy78DDWD9iaZGUhZg=@protonmail.com' \
    --to=pipcet@protonmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=yantar92@posteo.net \
    /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 public inbox

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

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 read-only IMAP folder(s) and NNTP newsgroup(s).