Automattic / simplenote-macos

Simplenote for macOS
https://simplenote.com
GNU General Public License v2.0
1.49k stars 168 forks source link

Note with many ★ characters has slow typing #390

Open cameronvoell opened 5 years ago

cameronvoell commented 5 years ago

Expected

Typing in a note should show instant feedback, independent of the type of characters in the note

Observed

A large note with ~1300 ★ characters shows some noticeable slowness when editing the note in Simplenote macOS. If you replace the ★ with ☆, the slowness disappears. (possibly something unique about how this character is represented in macOS code? https://www.fileformat.info/info/unicode/char/2605/index.htm)

Reproduced

  1. Create a note with many ★ characters
  2. Start typing rapidly
  3. Notice the cursor is falling behind the characters that you are typing
  4. Notice that if you replace the black stars with ☆ characters, the slowness is solved.

See this folder for videos and sample text showing the issue: https://drive.google.com/drive/folders/17de2xj-bMORWlYXjwzIVWOZF3Kqg0kRn?usp=sharing

Note the slow typing note seemed fine on iOS, Android, and in the electron app tested on Mac and on the Web.

Tested on: MacBook Pro running macOS Mojave 10.14.6 (18G103). Simplenote macOS version 1.7.0

cameronvoell commented 5 years ago

Note this was first reported on zendesk: 2394858

dmsnell commented 5 years ago

In my own tests with the macOS app I'm seeing major performance issues with the ★s; but interestingly enough switching revisions is almost instant. In my flabbergasted state I can confirm that the hollow stars do not incur the same penalty.

The full stars weigh too much, obviously.

possibly something unique about how this character is represented in macOS code?

Both star glyphs are basic single-code-unit values in UTF-16 and both are three bytes in UTF-8, so there's no funny business like surrogate pairs or combining marks or mismatched lengths.

markbult commented 5 years ago

The full stars weigh too much, obviously.

: D As the customer who reported this, I applaud the humor.

Fortunately not a catastrophic bug, but a weird one I hope will get fixed.