My database now contains almost 2200 jumps and loading times are noticeably increasing, currently >2 minutes on a fast SSD. Is there something I can do to speed up loading times? Or is Captain's Log meant to deal with smaller database sizes so should I just move my old logs to another place and start a new database from scratch?
p.s. with loading times I mean initial loading of the program, once loaded it's working fast and snappy.
It'll take longer and longer the more jumps - I've already tried various ways of making the loading faster. It's all down to the
table widget.
Basically, it's slow. I thought it might have been because I'm doing on-the-fly icon generation for the stars in that jump table, but even when I disabled that, loading and populating the table purely with text didn't speed things up much - it does speed things up (you can compare loading 2000 jump entries with no stars/planets entered, only jump, with another 2000-jump database which has been filled with star/planet info and yes the "empty" 2000-jump database is quicker to load. Eventually I came across information in StackOverflow that, indeed, QTableWidget is slow.
There is a
QTableView which uses a Model/View approach, in which I could create a model of the CL database, and then provide that model to the QTableView, and that would be much faster. However, I can't do this, because I want the star icons in the table view, and that approach means having to remove the icons and having a text-only table. And I don't like that.
So currently, you have a choice; 1) Treat the database as one particular stretch of your current voyage - i.e. Create a new database for every X Kylies in your current jaunt.
or 2) Be patient and let the database load up and the jump table populate.
Of course, I'll keep trying to get the table populated quicker - it's annoying for me too, but generally I'm used to how it works and just load up CL before I start the game.
Lastly, there is one approach I'm thinking of taking; as mentioned above, loading a 2000-jump table filled with star/planet info IS slower compared to an equivalent not-filled DB, so I'm going to try a 2-phase load thusly :
1) Load the text data only (time and system name and notes),
2) Go back and then load and generate the star icons in a background process.
This should get CL up and running and usable faster initially, then it's just a case of waiting for the star icon generation to catch up whilst you go about your business.
This will take a bit of careful thought, planning, and coding, so don't expect that to be in the next version coming out
Regards o7