D15173: Add a new ISO 3166 code to country name mapping table
Volker Krause
noreply at phabricator.kde.org
Fri Aug 31 07:51:56 BST 2018
vkrause added a comment.
In D15173#317976 <https://phabricator.kde.org/D15173#317976>, @pino wrote:
> Please lookup the strings at runtime, instead of embedding them in the library.
> Otherwise, an update to iso-codes (like updating the name of a country) will break the mapping, since the installed translations will not reflect the old text embedded.
Yes, there are downsides with this approach. The reason it's done that way is that the old runtime lookup was way too slow (it's the reason I started looking into this code in the first place, it was dominating runtime cost when scrolling the KDE Itinerary timeline and when benchmarking data extraction, and that includes heavy PDF parsing...). The alternative would be a single load and keep all of the data in per-process memory to mitigate most of that, compared of this now being in shared read-only data. This function is potentially called in models (the worst case might be the locale-aware sorted country name combo box in KDE Itinerary, opening the page containing this takes a few seconds on my phone), so performance matters here.
IMHO this approach is preferable, as country name change intervals tend to be larger than our release cycles, and therefore don't justify the runtime performance and memory trade-offs.
REPOSITORY
R174 PIM: KContacts
REVISION DETAIL
https://phabricator.kde.org/D15173
To: vkrause, mlaurent, pino
Cc: pino, mlaurent, svuorela, kde-pim, dvasin, rodsevich, winterz, vkrause, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20180831/7728a12a/attachment.html>
More information about the kde-pim
mailing list