Skip to content

Conversation

@dg-pb
Copy link
Contributor

@dg-pb dg-pb commented Dec 18, 2025

S="
from difflib import get_close_matches
possibilities = [f'word{i}' for i in range(1000)]
"

$PYEXE -m timeit -s $S 'get_close_matches("word", possibilities)'
# current - 8.0 ms
# after `ratio()` - 7.2 ms
# after `__contains__` - 6.9 ms

Copy link
Contributor

@johnslavik johnslavik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is now simpler, nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants