Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Huge delay for completions when not sorting



On 1 Jul 2018, at 12:56, Martin Vaeth <martin@xxxxxxxx> wrote:
>I would have expected that the line
>
>zstyle ':completion:*' sort false
>
>speeds things up if there is a huge number of completions.
>However, quite the opposite is true.

It's to do with the way it checks for duplicates in the unsorted results (-V
without -1 or -2). For each completion possibility, it performs a series of
checks against every subsequent possibility (compcore.c @ 3239)

I'm pretty bad at maths, but i think that for 40'000 unique possibilities it'll
have to make, like, 800 million calls to strcmp()

dana



Messages sorted by: Reverse Date, Date, Thread, Author