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:
Reduce the frequency of calls to recalculate warnings by using a debounce function to only trigger the recalculation 0.5 seconds after typing stops.
Batch DOM measurements and mutations to reduce layout thrashing using the fastdom library
Eliminate extraneous input events by tightening up the mutation observer logic
It also adds more test coverage for the mutation observer-related code.
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