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

Write automated performance test for long emails #179

Closed sbrudz closed 1 year ago

sbrudz commented 1 year ago

Per the discussion in https://github.com/defmethodinc/just-not-sorry/pull/174#discussion_r1103292660, write an automated test to verify that adding large amounts of text to an email will not degrade the performance of the Gmail compose editor.

Cover two scenarios:

  1. Keep adding paragraphs of text without any warning phases
  2. Keep adding paragraphs of text containing multiple warning phrases

After each addition, check for responsiveness to verify that JustNotSorry is not blocking the main thread. This could be done triggering a blur and then a focus event.

Ideally, the performance should be consistent no matter how many warning phrases appear. With the current code (v2.4), scenario 2 performs worse the more warning phrases are added to the email.

Eventual goal is that 1,000 words of text with 400 warning phrases should be able to go from no warnings to showing warnings and being fully responsive for editing within 1 second or less.

With the v2.4 code, it takes almost 30 seconds to become fully responsive with this amount of text and warning phrases, which is not good. Creating an automated test to check for performance is the first step towards addressing this issue.

Sample text to use in text:

I'm sorry about being so sorry. I'm just not sorry about being sorry. Where is it? Does that make sense? Oh, I'm just sorry. So much sorry. Is that okay? Do you mind? Forgive me for trying to be yoda. I'm no expert, but I'm sorry about being sorry. I'm actually just sorry, very, very sorry. I kind of want to know, does this make sense? I feel that I believe honestly that this might be a stupid question.