2022-06-17 GnuCash IRC logs

00:04:08 *** sbluhm has joined #gnucash
00:11:10 *** mauritslamers has quit IRC
00:14:06 *** mauritslamers has joined #gnucash
00:14:06 *** ChanServ sets mode: +v mauritslamers
00:27:23 *** sbluhm has quit IRC
00:29:59 *** sbluhm has joined #gnucash
00:32:29 *** David has quit IRC
00:32:39 *** David has joined #gnucash
00:33:44 *** sbluhm has quit IRC
00:36:16 *** mauritslamers has quit IRC
00:38:45 *** mauritslamers has joined #gnucash
00:38:45 *** ChanServ sets mode: +v mauritslamers
00:50:30 *** mauritslamers has quit IRC
00:53:08 *** mauritslamers has joined #gnucash
00:53:09 *** ChanServ sets mode: +v mauritslamers
01:01:54 *** mauritslamers has quit IRC
01:10:33 *** fell has quit IRC
01:11:14 *** mauritslamers has joined #gnucash
01:11:15 *** ChanServ sets mode: +v mauritslamers
01:11:53 *** fell has joined #gnucash
01:11:53 *** ChanServ sets mode: +o fell
01:26:58 *** Gandalf has joined #gnucash
01:35:58 *** mauritslamers has quit IRC
01:38:22 *** mauritslamers has joined #gnucash
01:38:23 *** ChanServ sets mode: +v mauritslamers
01:42:31 *** mauritslamers_ has joined #gnucash
01:42:31 *** ChanServ sets mode: +v mauritslamers_
01:43:42 *** mauritslamers has quit IRC
01:47:06 *** mauritslamers_ has quit IRC
01:53:58 *** mauritslamers has joined #gnucash
01:53:58 *** ChanServ sets mode: +v mauritslamers
02:14:47 *** mauritslamers has quit IRC
02:17:21 *** mauritslamers has joined #gnucash
02:17:21 *** ChanServ sets mode: +v mauritslamers
02:24:05 *** mauritslamers has quit IRC
02:26:28 *** mauritslamers has joined #gnucash
02:26:28 *** ChanServ sets mode: +v mauritslamers
02:41:31 *** NoobAlice has quit IRC
03:07:27 *** chris has joined #gnucash
03:07:27 *** ChanServ sets mode: +v chris
03:07:27 *** gncbot sets mode: +o chris
03:23:26 *** bertbob has quit IRC
03:24:04 *** sbluhm has joined #gnucash
03:27:01 *** bertbob has joined #gnucash
03:27:01 *** ChanServ sets mode: +v bertbob
03:27:05 *** sbluhm has quit IRC
03:48:45 *** sbluhm has joined #gnucash
03:54:02 <chris> fell: shouldn't xaccAccountOrder and friends use g_utf8_collate instead of g_strcmp0?
03:59:33 <fell> Chris, i suspect many parts of gnucash were written for ASCII instead of utf-8. So if you see them, fix them please!
04:04:44 <chris> hmm
04:06:57 <chris> you wouldn't like the performance drop that comes with g_utf8_collate
04:07:51 *** TownsendHardware has quit IRC
04:08:17 *** TownsendHardware has joined #gnucash
04:08:48 <Simon> 😲
04:15:41 <chris> however qof-string-cache.cpp *could* cache the utf8_collate_keys and strcmp them...
04:16:24 <Simon> I'd take a different approach
04:16:30 <chris> go on
04:17:04 <Simon> The list of accounts doesn't change that often, so just maintain a sorted list of them
04:17:59 <Simon> Have a link from the account to its index in the list and you can now compare the order very quickly
04:19:17 <Simon> The overhead on inserting a new account (updating all the indexes) will be much less than any on demand sorting by string
04:24:18 <chris> Maybe. Sounds very hacky.
04:27:00 <Simon> So is reading strings a billion times to find the order of things
04:27:52 <Simon> C++ has ordered lists (sets) but not the index back to find the order of something, it'd do a binary search
04:28:56 <Simon> Without the link back to its position that would be slower than strcmp on everything because it'd be a binary search strcmp on everything
04:29:38 <Simon> You could have a generic C++ sorted list implementation that kept a reference to an item's position in the list as a reference, then you could update it easily
04:31:20 <Simon> The item could only be sorted once so that wouldn't be the general container of it (you'd want to make other lists of accounts) but it would give it a sortable property for comparing the order
04:31:28 <Simon> of items
04:34:28 *** PowaBanga has quit IRC
04:39:11 *** PowaBanga has joined #gnucash
04:40:34 <chris> I think it's doable if xaccAccountOrder is redefined.
04:43:30 *** sbluhm has quit IRC
04:51:58 *** sbluhm has joined #gnucash
05:08:12 *** sbluhm has quit IRC
06:11:54 *** PowaBanga has quit IRC
06:14:56 *** PowaBanga has joined #gnucash
06:26:53 *** sbluhm has joined #gnucash
07:03:37 *** sbluhm has quit IRC
08:00:50 *** sbluhm has joined #gnucash
08:15:53 <chris> Simon: even easier: https://github.com/Gnucash/gnucash/pull/1352
08:21:05 *** sbluhm has quit IRC
08:26:49 *** warlord has joined #gnucash
08:50:48 <Simon> :)
08:52:14 *** sbluhm has joined #gnucash
09:05:21 *** sergiomiguelrp has quit IRC
09:17:22 *** ChanServ sets mode: +qo warlord warlord
09:21:29 *** sbluhm has quit IRC
09:37:44 *** sbluhm has joined #gnucash
09:40:40 *** mauritslamers has quit IRC
09:43:13 *** mauritslamers has joined #gnucash
09:43:13 *** ChanServ sets mode: +v mauritslamers
09:45:15 *** sbluhm has quit IRC
10:13:15 <chris> Ultimately I don't think it's worth it... most reasonable books wouldn't have more than a few dozen accounts, and caching this list seems overkill.
10:14:18 <chris> So, if jralls agrees let's just change g_strcmp0 to g_utf8_collate.
10:14:47 <chris> Trans and Splits sorting already use g_utf8_collate.
10:16:13 <chris> ^ and fell of course
11:00:27 *** Vafa has joined #gnucash
11:00:27 *** ChanServ sets mode: +v Vafa
11:12:06 *** guak has joined #gnucash
11:12:56 *** sbluhm has joined #gnucash
11:57:09 *** NoobAlice has joined #gnucash
11:57:09 *** ChanServ sets mode: +v NoobAlice
12:03:56 *** sbluhm has quit IRC
12:09:27 <Simon> I have 1425 accounts
12:09:53 <Simon> <@chris> you wouldn't like the performance drop that comes with g_utf8_collate <-- this suggests that there is a noticeable performance change
12:19:39 *** sbluhm has joined #gnucash
12:31:39 *** sbluhm has quit IRC
12:40:31 *** sbluhm has joined #gnucash
12:45:48 *** sbluhm has quit IRC
12:55:41 *** Vafa has quit IRC
12:57:23 *** sbluhm has joined #gnucash
13:21:28 *** Gandalf1 has joined #gnucash
13:21:55 *** Gandalf has quit IRC
13:21:55 *** Gandalf1 is now known as Gandalf
13:56:04 *** Gandalf has quit IRC
13:58:56 *** ArtGravity has quit IRC
14:03:07 *** AdrienM has quit IRC
14:03:24 *** AdrienM has joined #gnucash
14:03:24 *** ChanServ sets mode: +v AdrienM
14:07:09 *** sbluhm has quit IRC
14:48:43 *** Vafa has joined #gnucash
14:48:43 *** ChanServ sets mode: +v Vafa
15:07:32 *** sbluhm has joined #gnucash
15:13:19 *** gjanssens has joined #gnucash
15:13:19 *** ChanServ sets mode: +o gjanssens
15:49:01 *** Gandalf has joined #gnucash
16:21:56 *** David has quit IRC
16:23:25 *** David has joined #gnucash
16:43:33 *** sbluhm has quit IRC
16:54:35 *** Gandalf has quit IRC
16:54:38 <jralls> Simon, g_utf8_collate's performance issue is that it has to normalize the unicode because there are sometimes several ways to produce the same character representation. Then it has to get the current locale and create a sort-order key based on the locale's collation sequence. It has to do that for each string, then compare the two and return -1, 0, or 1 depending on which key is greater.
16:57:12 *** gjanssens has quit IRC
16:57:17 <jralls> GLib provides https://developer-old.gnome.org/glib/stable/glib-Unicode-Manipulation.html#g-utf8-collate-key to get the keys, which can then be compared with a straight strcmp.
17:00:22 <jralls> chris, when sorting a list of utf-8 strings one should process it first into a new list of struct {string, key} and then pass strcmp instead of g_utf8_strcmp as the order function.
17:24:05 *** mydogsnameisrudy has joined #gnucash
17:54:16 <jralls> chris, you rather misrepresented to fell xaccAccountOrder's use of g_strcmp0. What you changed is the comparison of the Account Code. The Account Name is already compared with safe_utf8_collate.
19:35:38 *** paul has joined #gnucash
19:57:37 <fell> jralls, without a msgmerge the sringfreeze is useless.
19:59:37 <fell> I made one now locally, but I am not amused. Over 100 new messages because chris added the dialog name as msgcontext.
20:03:08 <fell> I don't see the difference between a normal "Buy" and
20:03:10 <fell> msgctxt "Stock Assistant: Transaction Type"
20:03:12 <fell> msgid "Buy"
20:03:13 <fell> msgstr "Kauf"
20:20:18 <fell> perhapswe should exclude gnucash/gnome/assistant-stock-transaction.cpp from make pot until it is fixed?
20:22:20 *** guak has quit IRC
20:47:03 <chris> Simon jralls I hadn't profiled g_utf8_collate and hadn't seen it being used for account name. The fact it's already being used in account name, transaction and split sorting seems to suggest the perfomance penalty is not noticeable.
20:55:01 <chris> Simon: perhaps you could try replace g_strmp0 with safe_utf8_collate with your 1425 accounts and report back?
22:41:26 <chris> fell: I agree Stock transaction: Transaction Type doesn't need contextual cue
22:42:34 <chris> but the "page name" and "Action field" do
23:15:45 *** paul has quit IRC
23:28:31 *** chris has quit IRC
23:35:21 *** sbluhm has joined #gnucash
23:47:02 *** Vafa has quit IRC