forked from rDrama/rDrama
1
0
Fork 0
rDrama/files
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
..
classes PCM content: swap banner. 2022-06-01 16:08:33 -04:00
helpers Improve slur replacer performance. 2022-06-07 21:16:58 -04:00
mail fds 2022-05-26 00:26:03 +02:00
routes Refactor reddit mentions, move to cron. 2022-06-07 10:42:24 -04:00
templates Make pat anims unaffected by anim setting. 2022-06-07 07:29:07 -04:00
tests vdffsd 2022-05-23 00:45:04 +02:00
__init__.py Enable flask command, add cron target. 2022-06-07 06:57:26 -04:00
__main__.py Design improvements take 2 + Scroll to top (#291) 2022-05-30 01:36:06 -04:00
cli.py Enable flask command, add cron target. 2022-06-07 06:57:26 -04:00