Tdesktop: 100% CPU usage and slow input response when Windows spellchecking is enabled

Created on 15 Oct 2020  路  11Comments  路  Source: telegramdesktop/tdesktop

Steps to reproduce

  1. Open settings and enable system spellchecking
  2. Open any chat tab
  3. Write a lot of symbols in chat textbox like:
......................................................................................................................................................................................................................................

Expected behaviour

Spellchecking method should be called only once, 200 ms after the last input, not on every key press (debounce event via timer required).

Actual behaviour

On each symbol type Telegram calling spellcheck method and load CPU on each key press.
cpu

Configuration

Operating system: Windows 10 1803
Version of Telegram Desktop: 2.4.3
Used theme: Default

bug

Most helpful comment

Thanks for your report, I'll check it later.

All 11 comments

Are you sure that this is due to the spellchecker? Telegram writes drafts synchronously to disk on each text write and that may cause the same behavior, there are an issue for that already:#7952 (the issue is cross-platform even though reported by a Linux user)

@ilya-fedin Yes, I'm sure. If I turn off grammar checking, CPU consumption is 0.1% for Telegram.exe. I just checked it out.

Looks like #8612 already reported about it.

200 ms after the last input

Just wondering, why 200ms exactly?

@ilya-fedin 100-200ms is average value of user reaction. So it's a good value for debounce / throttling events.

Thanks.

Thanks for your report, I'll check it later.

@grandsilence Are you sure that pure dots without any letter are the cause of high CPU usage?

@23rd Yes, I鈥檓 sure. Just dots cause of 100% cpu usage. I can make a GIF.

I can make a GIF.

I would appreciate it.

@23rd GIFs:

Spellchecking is ON

Spellchecking is enabled

Spellchecking is OFF

Spellchecking is disabled

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ArmeF97 picture ArmeF97  路  3Comments

TotalKrill picture TotalKrill  路  3Comments

matteotumiati picture matteotumiati  路  3Comments

Liudvikas picture Liudvikas  路  3Comments

luisalvarado picture luisalvarado  路  3Comments