GNU bug report logs -
#47711
27.1; Deferred highlighting support in `completion-all-completions', `vertico--all-completions`
Previous Next
Reported by: Daniel Mendler <mail <at> daniel-mendler.de>
Date: Sun, 11 Apr 2021 20:52:01 UTC
Severity: normal
Found in version 27.1
Done: Daniel Mendler <mail <at> daniel-mendler.de>
Bug is archived. No further changes may be made.
Full log
Message #281 received at 47711 <at> debbugs.gnu.org (full text, mbox):
On 25/10/2023 20:52, João Távora wrote:
> And make sure to put 300 000 symbols in the obarray. The symbols are
> prefixed "yoyo" deliberately.
>
> (cl-loop repeat 300000 do (intern (symbol-name (gensym "yoyo"))))
>
> First a micro-benchmark:
>
> ;; Daniel's patch worked by Dmitry (v3)
> (benchmark-run 50
> (let ((completion-styles '(flex)))
> (completion-filter-completions "" obarray 'fboundp 0 nil)
> (completion-filter-completions "yo" obarray 'fboundp 0 nil)
> (completion-filter-completions "yoo" obarray 'fboundp 0 nil)
> ));; => (12.192422429999999 3 0.107881004)
>
>
> ;; lazy-hilit v4 patch attached in this email
> (benchmark-run 50
> (let ((completion-styles '(flex))
> (completion-lazy-hilit (cl-gensym)))
> (completion-all-completions "" obarray 'fboundp 0 nil)
> (completion-all-completions "yo" obarray 'fboundp 0 nil)
> (completion-all-completions "yoo" obarray 'fboundp 0 nil)
> ));; => (12.267915333 4 0.14799709099999991)
Note on this particular test:
The loop on the first line only creates the symbols in the obarray, but
not functions. As a result, all the completion-all-completions calls
return nil because of the 'fboundp' predicate. When you change the
predicate argument to nil, these timings change considerably (so it's
wiser to reduce the number of repetitions to 1 or 5 at most), with
completion-filter-completions being ~2.5x faster than the other.
It is slower in the sorting step, though: mostly due to the extra
consing created with the alist to-be-sorted, I guess, but also because
of the repeated string-match call (which, while fast and much faster
than the match-data call, is still not free).
That's how when compared in practice using fido-vertical-mode the
results were about the same.
This bug report was last modified 172 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.