HTML sanitization is too slow
With a post that contains 4999 newlines and one character, the resulting html will contain nearly 5000 <p></p>
pairs.
To display this post, my i5-8350U CPU @ 1.70GHz will take around 250ms. This time is mostly spent in HTML.filter_tags
, removing it from ActivityView.ex (line 248) speeds it up to normal levels (< 5ms).
Overall, I think we need a faster library for sanitation, but for now it might also be alright to just cache html for a while to prevent accidental DDOSing.