emacs-devel
[Top][All Lists]
Advanced

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

Re: Improving Emacs' iCalendar support


From: Ihor Radchenko
Subject: Re: Improving Emacs' iCalendar support
Date: Fri, 25 Oct 2024 18:59:38 +0000

Richard Lawrence <rwl@recursewithless.net> writes:

> Can you tell me a bit more about the performance benefits? Do these
> mostly just stem from the use of an array for :standard-properties?

:standard-properties and lazy evaluation.

> (You get this for free with cl-structs, too.)

Not exactly for free. There are extra type checks in cl-structs, and they
are slower to create. I did the benchmarking and decided to go with less
sophisticated data structure supported by inlined accessors/setters.

Also, as a technical detail that is irrelevant to your case, I had to
preserve backwards compatibility with the existing design to the highest
extent possible.

> ... Or is it more about when
> and how parsing happens? (This is something I feel like I've never
> grasped in org-element...in the past I've been confused because the
> properties I'd see when calling e.g. org-element-at-point would be
> different than the ones available in some other context.)

org-element-ast has little to do with parsing details. However, it does
provide features we need during parsing: (1) storing arbitrary
properties in addition to "standard"; (2) supporting "plain string" as a
special variant of AST leaf; (3) supporting anonymous nodes - simple
list of AST nodes; (4) lazy evaluation of properties - org-element uses
the APIs from org-element-ast to defer large parts of parsing to when
the relevant part of the AST node is actually requested by a caller.

For org-element-at-point, you may be confused because Org parser can
work in several modes, parsing down to certain
"granularity". org-element-at-point usually limits itself to parsing
down to paragraph level (in particular, it does not parse markup
inside headline :title leaving it as a simple plain text leaf), while
what you see during export is the most complete parsing mode, reaching
down to markup (in headlines, :title then contains a collection of Org
"objects" - the markup is parsed).  This has nothing to do with the AST
layout.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

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