Skip to content

tracking.el: slow shortening #286

@defanor

Description

@defanor

tracking-shorten applies shorten-strings to the whole buffer list, which may be large. shorten-strings, in turn, checks each string against all the other strings separately, making it even slower than it may be. As a result, there are lags, which would be nice to avoid.

To reproduce it, 900+ buffers is enough to get lags on a modern computer.

One way is to only shorten circe buffer names instead of all of them, but that may not be nice for switching between buffers in case if there are non-circe buffers with names similar to circe ones.

Caching may work, but not plain input/output caching, since the buffers may change quite often as well: something closer to dynamic programming may help. Perhaps forming trees with char maps, where keys are chars of a name, and values are pairs of counters and subtrees? Adding and removing names shouldn't take much more operations than a length of a buffer name, shortening would just require to follow a tree until there's 1 on a counter.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions