Bug 387072 - Slow switch to ledgerview
Summary: Slow switch to ledgerview
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 4.8.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-18 15:03 UTC by Ralf Habacker
Modified: 2017-11-18 15:07 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.8.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2017-11-18 15:03:41 UTC
from https://phabricator.kde.org/p/mcherey/

This bug was annoying me for a long time. I use kmymoney for several years and I have about 15k entries (about 5k per one account). Every first switch to ledger view takes ~5s. (package from repo, version 4.6) I was pretty sure that I don't have so much data to process so long.
Comment 1 Ralf Habacker 2017-11-18 15:04:20 UTC
https://phabricator.kde.org/p/mcherey/

After debugging I saw that problem is in Register::resize that every time goes through all 5k entries for each visible columns and calculating minimal width of column by rendering its text. Register::resize is called about 4 times per first switch (3 times with 'force==true' flag, so guard at the beginning of the function doesn't help us).
So this little optimization makes it possible to call Register::resize as much as you want and it won't affect performance if nothing changed in items.

review https://phabricator.kde.org/D8507
Comment 2 Ralf Habacker 2017-11-18 15:07:08 UTC
Git commit 275ad37820c254d361059f95abbfdf1e71016c94 by Ralf Habacker.
Committed on 18/11/2017 at 15:06.
Pushed by habacker into branch '4.8'.

Speed up first switch to ledgerview

Reviewers: #kmymoney, tbaumgart

Reviewed By: tbaumgart

Subscribers: tbaumgart

Tags: #kmymoney
FIXED-IN:4.8.2
Differential Revision: https://phabricator.kde.org/D8507

M  +12   -1    kmymoney/widgets/register.cpp
M  +1    -0    kmymoney/widgets/register.h

https://commits.kde.org/kmymoney/275ad37820c254d361059f95abbfdf1e71016c94