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

Add profanity filter to autogenerated shortlinks (for #1174) #1224

Merged
merged 2 commits into from
Jul 1, 2021

Conversation

jace
Copy link
Member

@jace jace commented Jul 1, 2021

This PR adds a profanity filter to auto-generated shortlinks using better_profanity. This package has a performance problem in the current release 0.7.0 as described at snguyenthanh/better_profanity#19.

Performance test:

$ python -m timeit -s "from funnel.models.shortlink import random_bigint, bigint_to_name; \
from better_profanity import profanity; \
cf = profanity.contains_profanity" -- \
"cf(bigint_to_name(random_bigint()))"

With the current 0.7.0:

500 loops, best of 5: 679 usec per loop
500 loops, best of 5: 672 usec per loop
500 loops, best of 5: 700 usec per loop

With the previous 0.6.1:

50000 loops, best of 5: 10.8 usec per loop
20000 loops, best of 5: 9.9 usec per loop
20000 loops, best of 5: 11.4 usec per loop

Therefore we have the dependency set to better_profanity<0.7 until this issue is fixed.

@jace jace mentioned this pull request Jul 1, 2021
15 tasks
@jace jace changed the title Add profanity filter to autogenerated shortlinks Add profanity filter to autogenerated shortlinks (for #1174) Jul 1, 2021
@jace jace merged commit 03356c8 into master Jul 1, 2021
@jace jace deleted the profanity-filter branch July 1, 2021 22:25
vidya-ram pushed a commit that referenced this pull request Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant