all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Keith David Bershatsky <esq@lawlist.com>
Cc: emacs-devel@gnu.org
Subject: Re: Choosing a data structure for cache of multiple fake cursors.
Date: Tue, 25 Dec 2018 15:36:26 +0200	[thread overview]
Message-ID: <83ftul919h.fsf@gnu.org> (raw)
In-Reply-To: <m2h8f2ku3f.wl%esq@lawlist.com> (message from Keith David Bershatsky on Mon, 24 Dec 2018 22:18:12 -0800)

> Date: Mon, 24 Dec 2018 22:18:12 -0800
> From: Keith David Bershatsky <esq@lawlist.com>
> 
> The elements of the cache are as follows:  x [int]; fx [frame x | int]; y [int]; fy [frame y | int]; hpos [int]; vpos [int]; h [height | int]; cursor_type [int]; cursor_width [int]; foreground [vector of 3 doubles]; background [vector of 3 doubles]; active_p [bool]; minimal_p [bool]; flavor [int]; posint [int].

You didn't describe what each element means.

> In this example, we want to find all VPOS entries in the cache for 5, 8 and 25 and do two things:  (i) erase the fake cursors on the line; and, (2) recalculate/redraw the fake cursors on those lines based on the new layout.
> 
> Assuming that we are dealing with a potential of 200+ fake cursors on a visible window, what is the best data structure for performance and ease of add/removing elements (with 15 sub-elements)?

If the number of elements is fixed, then a vector would be more
convenient, but other than that, I don't see why it would be a poor
choice to use a list.  We access and modify lists (and other Lisp
objects) from C code all the time, to say nothing of the fact that
these objects and the primitive operations on them are implemented in
C to begin with.



  reply	other threads:[~2018-12-25 13:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-25  6:18 Choosing a data structure for cache of multiple fake cursors Keith David Bershatsky
2018-12-25 13:36 ` Eli Zaretskii [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-12-25 19:21 Keith David Bershatsky

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=83ftul919h.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=esq@lawlist.com \
    /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.