Wordbook icon indicating copy to clipboard operation
Wordbook copied to clipboard

Reading takes to much time, cold start

Open ghost opened this issue 2 years ago • 4 comments

  • Wordbook version: From source code: (480fe1a61467dd4203cebabc76375f87279f74da)
  • Python version: Flatpak version, compiled with the Flatpak manifest.
  • Operating System: Ubuntu 23.04

Application is not properly starting. It got stock about 2 minutes at Reading database.

sabri@yakusha:/c/DEV/Karma/Wordbook$ flatpak run dev.mufeed.Wordbook --verbose
2023-05-25 17:43:37,088 - [INFO] [Thread-1 (_try_dl_wn)] (_download:95) download url: https://en-word.net/static/english-wordnet-2022.xml.gz
2023-05-25 17:43:37,088 - [INFO] [Thread-1 (_try_dl_wn)] (_download:96) download cache path: /home/sabri/.var/app/dev.mufeed.Wordbook/data/wordbook/wn/downloads/3e786e15b7f43627beddafdfa4a95807a5b12cf7
2023-05-25 17:43:37,090 - [DEBUG] [Thread-1 (_try_dl_wn)] (connectionpool:1048) Starting new HTTPS connection (1): en-word.net:443
2023-05-25 17:43:37,415 - [DEBUG] [Thread-1 (_try_dl_wn)] (connectionpool:546) https://en-word.net:443 "GET /static/english-wordnet-2022.xml.gz HTTP/1.1" 200 12529005
2023-05-25 17:43:48,652 - [INFO] [Thread-1 (_try_dl_wn)] (_add:105) adding project to database
2023-05-25 17:43:48,652 - [INFO] [Thread-1 (_try_dl_wn)] (_add:106)   database: /home/sabri/.var/app/dev.mufeed.Wordbook/data/wordbook/wn/wn.db
2023-05-25 17:43:48,652 - [INFO] [Thread-1 (_try_dl_wn)] (_add:107)   project file: /home/sabri/.var/app/dev.mufeed.Wordbook/data/wordbook/wn/downloads/3e786e15b7f43627beddafdfa4a95807a5b12cf7
2023-05-25 17:43:48,863 - [INFO] [Thread-1 (_try_dl_wn)] (_db:82) initializing database: /home/sabri/.var/app/dev.mufeed.Wordbook/data/wordbook/wn/wn.db
2023-05-25 17:45:55,732 - [INFO] [ThreadPoolExecutor-0_0] (utils:66) Initializing WordNet.
2023-05-25 17:45:55,736 - [INFO] [ThreadPoolExecutor-0_0] (utils:66) Fetching WordNet, wordlist.
2023-05-25 17:45:57,530 - [INFO] [ThreadPoolExecutor-0_0] (utils:66) WordNet is ready.

ghost avatar May 25 '23 14:05 ghost

Did it not start at all or did it start after 2 minutes?

mufeedali avatar May 27 '23 19:05 mufeedali

Yest It started in 2 minutes and 20 seconds.

I think I have a normal computer. It's not shaky.

CPU: 11th Gen Intel i7-11370H (8) @ 4.800GHz 
GPU: NVIDIA GeForce RTX 3060 Mobile / Max-Q 
GPU: Intel TigerLake-LP GT2 [Iris Xe Graphics] 
Memory: 3778MiB / 31773MiB 

ghost avatar May 27 '23 19:05 ghost

This is only on the first launch, right? Subsequent launches should be instant.

If so, then it's not Wordbook issue, it's wn (Python library) building the database. Also takes ~2m for me, eats up 1 CPU and ~1.2GB RAM. Could be faster, but any work should be directed to wn upstream

jn64 avatar Jul 14 '23 10:07 jn64

I'm looking into how to bundle the latest OEWN into the Flatpak. Basically #35 , which should pretty much permanently fix issues like this. Or if there's really no other choice, I might move away from using wn. Let's see.

mufeedali avatar Dec 11 '23 16:12 mufeedali