yomidevs / yomitan

Pop-up dictionary browser extension. Successor to Yomichan.
https://yomitan.wiki
GNU General Public License v3.0
1.28k stars 100 forks source link

Longer word scan times and CPU usage jump #883

Closed akacoda1 closed 6 months ago

akacoda1 commented 6 months ago

(in windowed mode)If I scan a new word or select a word from a sentence i've copied. I takes about 7 seconds to scan the new word and cpu usage jumps up 50%

I have a i7 10700F and nothing else is running in the background. This just started happening randomly after I use microsoft power toys OCR to scan a word but I have been using their OCR for about a month now and never had this issue

Extension version: Yomitan (development build) 24.4.28.0 Platform: Windows Browser: Chrome Language: en-US AnkiConnect version: 6 Installed dictionaries: 三省堂 スーパー大辞林, Pixiv [2023-11-24], KANJIDIC, 使い方の分かる 類語例解辞典, JMnedict, Kanjium Pitch Accents, JMdict (English), Anime & Jdrama Freq:, Conversation Corpus, KireiCake, 語源由来辞典, 明鏡国語辞典 第二版

jamesmaa commented 6 months ago

Could you repro and record a flame graph and upload it here? Want to see what the bottle neck is

akacoda1 commented 6 months ago

https://github.com/themoeway/yomitan/assets/143565784/f8bcf3ab-3430-439d-ab0f-332ede731dbe

seems to not evern wanna load anymore. When trying to flim this, it actually crashed my chrome lol

jamesmaa commented 6 months ago

Thanks for the video. It looks like yomitan is caught in some while loop with a potential memory leak. Could you run these steps and upload the results? https://developer.chrome.com/docs/devtools/performance#record

jamesmaa commented 6 months ago

Could you export and upload your yomitan settings as well?

akacoda1 commented 6 months ago

https://github.com/themoeway/yomitan/assets/143565784/0e82b153-1f23-4d0f-9732-5ae80b15b1ce yomitan-settings-2024-05-05-17-21-47.json

StefanVukovic99 commented 6 months ago

I can reproduce the issue with those settings

akacoda1 commented 6 months ago

ah okay then, figured out the issue. I had settings "Text Scan Length" under "Scanning" very high. Reducing it back to 16 as default fixed this issue.

akacoda1 commented 6 months ago

Having "Text Scan Length" at a high value like 9999 will cause extreme lag in the software. Reducing to its normal value (16) has resolved and issues I had.