Bug 414111 - Krita startup takes very long depending on size of files in recent files list
Summary: Krita startup takes very long depending on size of files in recent files list
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Usability (other bugs)
Version First Reported In: 4.2.7.1
Platform: Mint (Ubuntu based) Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-13 20:48 UTC by Strongheart
Modified: 2021-05-03 11:20 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Strongheart 2019-11-13 20:48:09 UTC
SUMMARY
When there are large image files in the recent files list, the program takes a long time to start ( meanwhile the splash screen shows the status "Loading Main Window..."). 
For example, on my PC, with 3 tiff-files of  ~700MB each in the recent files list, the startup took 3 minutes, with cleared recent files list it took 10 seconds.

STEPS TO REPRODUCE
1. Sequentially open and close some (1-3) large image files ( e.g. some .tif - files  with several 100 MB size ), so that the recent file list is filled.
2. Quit Krita and start again.
3. Clear recent files list, quit and start Krita again.

OBSERVED RESULT
Startup time at step 2. is significantly higher than at step 3.

EXPECTED RESULT
The list of recent files should not significantly increase the program startup time.

With older Krita Versions (e.g. 4.1.7) startup is faster ( also it does not display thumbnails in the recent files list ).



OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 4.15.0-66-generic
  Pretty Productname: Linux Mint 18.3
  Product Type: linuxmint
  Product Version: 18.3


Hardware Information

  GPU Acceleration: auto
  Memory: 16039 Mb
  Number of Cores: 4
  Swap Location: /Work/Krita/swap
Comment 1 Halla Rempt 2019-11-13 20:51:15 UTC
Yes, it does... But sorry, that's not a bug. That's because people want to see thumbnails for their recent files, and making a thumbnail of a big file takes longer. And 700 MB tiff files are silly big; almost as if they're astronomy photo's?
Comment 2 Strongheart 2019-11-15 22:18:11 UTC
(In reply to Boudewijn Rempt from comment #1)
> Yes, it does... But sorry, that's not a bug. That's because people want to
> see thumbnails for their recent files, and making a thumbnail of a big file
> takes longer. And 700 MB tiff files are silly big; almost as if they're
> astronomy photo's?

They are panorama pictures (e.g. 20000 x 4000 x 16bit).
The good thing: with *.kra -files (even with very big ones) it starts as quick as usual.
Comment 3 Halla Rempt 2019-11-16 11:03:04 UTC
Yeah, for kra files we simply open the zip file and read the thumbnail png image that's in there :-)
Comment 4 Halla Rempt 2019-11-16 11:03:52 UTC
Hm, maybe I could run the thumbnailing in a thread. Tiff, unfortunately, doesn't have a mandatory thumbnail embedded.
Comment 5 Felipe Lema 2021-04-21 00:59:36 UTC
would it be ok to load thumbnail in a separate thread /after/ startup Strongheart ?

Can I go ahead and work on this (loading thumbnails in a separate thread launched /after/ startup)?
Comment 6 Halla Rempt 2021-04-21 12:01:45 UTC
Yes, sure! Make sure you check out QFuture: that's probably the right tool to use here.
Comment 7 Strongheart 2021-04-21 22:09:29 UTC
Another way to solve this would be to store the thumbnails in the cache.
However, the procedure of storing thumbnails would be different in Windows and Linux, and because of the uncommon use case maybe its not worth the effort.
Comment 8 Felipe Lema 2021-04-25 04:36:09 UTC
Is there already a "it's currently loading" `QIcon` I can use as a stub / filler while I fetch the thumbnails?
Comment 9 Halla Rempt 2021-04-25 09:04:19 UTC
I don't think so.
Comment 10 Felipe Lema 2021-05-02 19:14:02 UTC
Created merge request for a fix

https://invent.kde.org/graphics/krita/-/merge_requests/830
Comment 11 Halla Rempt 2021-05-03 11:20:31 UTC
Fixed in 58790cae511f8633b3a336a651a999147315433a