Only add properties to the first candidate, and search for the properties in the candidates list. This should be better than what we do now, which is to propertize every candidate and later get the properties from the first candidate in the list.
For N candidates, the old way is always
(propertize N) + (search 1) + (sort N)
and the new way is
(propertize 1) + (search (N - x)) + (sort N)
where x is greater than or equal to 0. Assuming that get-text-property is no worse than propertize (which seems true in testing), the new way is never worse than the old way, and should usually be better.
Only add properties to the first candidate, and search for the properties in the candidates list. This should be better than what we do now, which is to propertize every candidate and later get the properties from the first candidate in the list.
For N candidates, the old way is always
and the new way is
where x is greater than or equal to 0. Assuming that
get-text-property
is no worse thanpropertize
(which seems true in testing), the new way is never worse than the old way, and should usually be better.