[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] [ANN] Lazy cache synchronization
From: |
Nicolas Goaziou |
Subject: |
[O] [ANN] Lazy cache synchronization |
Date: |
Thu, 20 Feb 2014 23:08:04 +0100 |
Hello,
I just pushed an update for parser cache.
Until then, synchronization was the weak spot of the cache mechanism, as
it happened in one row after each buffer change, with a linear
complexity by the number of elements in cache after point. In other
words, editing a very large buffer near its end was fast, but slow at
its beginning.
Now, synchronization happens lazily, which means the cache is only
updated when and where needed, or during idle time. Therefore the cache
mechanism scales a lot better.
Obviously, the more functions use it, the more it is profitable. Hence,
it would be nice to rewrite core functions so they use the parser (i.e,
`org-element-at-point' and `org-element-context'). For example,
functions like `org-in-clocktable-p', `org-in-commented-line',
`org-in-indented-comment-line' (which should be merged with the previous
one) or `org-in-verbatim-emphasis' are good starting points.
If you feel adventurous, synchronization can be controlled with the
following variables:
- `org-element-cache-sync-idle-time'
- `org-element-cache-sync-duration'
- `org-element-cache-sync-break'
Feedback (or benchmarks) welcome.
Regards,
--
Nicolas Goaziou
- [O] [ANN] Lazy cache synchronization,
Nicolas Goaziou <=