emacs-circe / circe

Circe, a Client for IRC in Emacs
GNU General Public License v3.0
395 stars 51 forks source link

Add `tracking-shorten-modes' to selectively shorten buffers #356

Closed jgkamat closed 3 years ago

jgkamat commented 5 years ago

By limiting shortened buffers to those actually using tracking.el or lui, we can gain a substantial performance improvement for tracking said buffers (when shortening).

Alternatively, we can add a variable to only shorten currently tracked buffers (ie: tracking-buffers), which will be even faster.

I actually prefer shortening only the currently tracked buffers even if it leads to non-deterministic shortening. Do you like that solution more?

See: #286, #346, #344

For me:

(benchmark-run 1000 (tracking-shorten nil))
tracking-shorten-modes: t
(8.734324133 8 4.102178583008936)
tracking-shorten-modes: (circe-channel-mode)
(2.075575641 2 1.031831622007303)

As you can see, we still have a way to go on this function (and others in the critical path), but it's a start. Unfortunately, it all seems to be in the shortening library (on this particular call).