[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rmsbolt.el [Was: Colorful line numbers]

From: João Távora
Subject: Re: rmsbolt.el [Was: Colorful line numbers]
Date: Sat, 23 Jul 2022 19:11:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> Looking up the line we're iterating in that hypothetical
>> Lisp structure would seem to amount to about the same work as looking
>> for a particulr text property in a known place of that same line.
> No, referencing a variable is much faster, because it doesn't involve
> finding the correct interval for a buffer position.

I don't know details of this data structure you are proposing but if
it's somehow a set of mappings between line ranges and faces (as you
described it), then you have to somehow traverse it to find, given a
particular line number, the correct mapping and the face to use in
maybe_produce_line_number().  Just as one would have to lookup a text
given for a particular buffer position related to that line.  But I'm
just speculating: I don't know what algorithm you have in mind.

I've understood that having text properties by itself can negatively
impact editing even if they don't contribute anything to the display.

And maybe updating your data structure could be cheaper, since adding
and removing things that aren't newlines doesn't require any update.
Then again, updating a Lisp structure is probably slower than updating a
optimized internal structure (a tree?)  for text properties.

So go ahead and do this structure you propose, if you have time and see
value in it.  Then we'll have something to compare against.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]