Problem
World/prefix data is lazy-loaded synchronously on first use: World::ensureWorldLoaded() (src/world.cpp:64-70) calls readWorld(), which runs the database queries to populate the prefix/entity maps on the main thread the first time a callsign/prefix lookup happens.
Additionally, World::readCTYCSV() (src/world.cpp:568-673) parses cty.csv synchronously on the main thread when the country file is (re)loaded.
User-visible symptom
- The first callsign the user types after starting KLog stalls the UI for ~0.5-2 s (worse on slow storage) while the world data loads.
- Startup/first-run is delayed by several seconds when cty.csv is being parsed.
Proposed fix
- Kick off world-data loading asynchronously right after the main window shows (e.g.,
QtConcurrent::run populating the maps, swapped in when ready), so the data is warm before the user types the first call.
- Run cty.csv parsing in a worker thread as well; it already runs inside a transaction, so only the threading/connection handling needs work.
Lower priority than the other performance issues from the analysis, but a cheap fix for a poor first impression at every app start.
Problem
World/prefix data is lazy-loaded synchronously on first use:
World::ensureWorldLoaded()(src/world.cpp:64-70) callsreadWorld(), which runs the database queries to populate the prefix/entity maps on the main thread the first time a callsign/prefix lookup happens.Additionally,
World::readCTYCSV()(src/world.cpp:568-673) parses cty.csv synchronously on the main thread when the country file is (re)loaded.User-visible symptom
Proposed fix
QtConcurrent::runpopulating the maps, swapped in when ready), so the data is warm before the user types the first call.Lower priority than the other performance issues from the analysis, but a cheap fix for a poor first impression at every app start.