defmethodinc / just-not-sorry

Chrome extension that warns you when you write emails using words which undermine your message
https://justnotsorry.com/
Other
243 stars 37 forks source link

Performance fixes #75

Closed sbrudz closed 4 years ago

sbrudz commented 4 years ago

This PR addresses performance issues with Just Not Sorry on long emails.

In version 1.6.2 (and earlier), a long email with many just's and sorry's will slow typing performance to a crawl. As noted in #65 this is because on each keystroke, the code is removing and re-adding all of the warnings. This causes layout thrashing and greatly reduces performance as the browser tries to catch up.

This PR makes the following changes to improve performance:

It also adds more test coverage for the mutation observer-related code.

Fixes #65