forked from rDrama/rDrama
1
0
Fork 0
rDrama/files/helpers
Snakes da82ea81d8 Improve slur replacer performance.
h/t @official-techsupport for digging into the regex performance and
coming up with one that greatly reduces backtracking. We see an
approximately 2x speedup under typical loads, which proves to be a
major overall savings in performance. Previously, censor_slurs was,
second to ORM DB accesses, by far the most time-consuming function
in the codebase under typical loads. It's still not ideal, but it is
much better.

Future options to improve this critical path further would be:
  1) Precompute a slur-replaced HTML, rather than recomputing
     each pageload. Storage is cheap.
  2) Tokenize the HTML and replace plaintext words using O(1)
     exact-match lookups to a dict.
2022-06-07 21:16:58 -04:00
..
actions.py Add lottershe badge logic, badge helper. 2022-06-06 00:07:38 -04:00
alerts.py a 500 error is much better than an XSS, bro 2022-06-07 12:03:51 +02:00
blackjack.py Add can_gamble user setting. 2022-05-30 05:32:45 -04:00
const.py Improve slur replacer performance. 2022-06-07 21:16:58 -04:00
cron.py Refactor reddit mentions, move to cron. 2022-06-07 10:42:24 -04:00
discord.py sfd 2022-05-07 06:13:19 +02:00
get.py fds 2022-05-25 22:16:26 +02:00
jinja2.py Add user title coin cost parameter. 2022-06-06 19:02:23 -04:00
lazy.py certified good commit 2022-05-25 19:01:29 +02:00
lottery.py Lottery: fix negative ticket quantity exploit. 2022-06-07 17:50:31 -04:00
media.py sfd 2022-05-27 19:19:12 +02:00
offsitementions.py Refactor reddit mentions, move to cron. 2022-06-07 10:42:24 -04:00
sanitize.py Add more TLDs to sanitize. 2022-06-03 17:01:32 -04:00
security.py mn 2022-05-05 01:09:46 +02:00
slots.py Add can_gamble user setting. 2022-05-30 05:32:45 -04:00
stats.py cron: Move charts from static to helper. 2022-06-07 08:31:24 -04:00
treasure.py Treasure: raise minimum reward 10 -> 12. 2022-05-31 20:23:19 -04:00
wrappers.py don't whitelist fagmins 2022-06-07 12:34:46 +02:00