Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only add properties for prescient-sort-full-matches-first to the first candidate. #148

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

okamsn
Copy link
Contributor

@okamsn okamsn commented Jul 4, 2023

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.

…rst candidate.

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.

Add function `prescient--get-sort-info`, to complement
`prescient--add-sort-info`.
@okamsn okamsn merged commit d7cc55d into radian-software:main Jul 20, 2023
4 checks passed
@okamsn okamsn deleted the adding-props branch July 20, 2023 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant