[Kmymoney-devel] Review Request: Add a cache to isProcessingDay to speed up holiday queries
Fernando Vilas
fvilas at iname.com
Sun Aug 15 15:14:44 CEST 2010
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/5033/#review7068
-----------------------------------------------------------
Ship it!
If it's raw speed you're after, QHash should beat QMap, though it probably does not matter much in this case.
d->m_holidayMap[(*holiday_it).date()] = false;
Also, the above code creates the element in the map if it does not exist, then assigns a value to it. For a bool it is not a big deal, but in the general case your original insert() statement is faster, especially for objects with expensive ctors.
Other than that, it looks good to me. Tested on Slackware-current with KDE SC 4.5RC3 for both backends.
- Fernando
On 2010-08-15 12:11:09, Alvaro Soliverez wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/5033/
> -----------------------------------------------------------
>
> (Updated 2010-08-15 12:11:09)
>
>
> Review request for kmymoney.
>
>
> Summary
> -------
>
> This is a quick and dirty fix to cache the calls to HolidayRegion. The best solution would be to call the holiday list and load that preemptively for a given period of time.
>
>
> This addresses bug 247912.
> https://bugs.kde.org/show_bug.cgi?id=247912
>
>
> Diffs
> -----
>
> /trunk/extragear/office/kmymoney/kmymoney/kmymoney.h 1163570
> /trunk/extragear/office/kmymoney/kmymoney/kmymoney.cpp 1163570
>
> Diff: http://reviewboard.kde.org/r/5033/diff
>
>
> Testing
> -------
>
> Tested it with region set to none and region set to Argentina.
>
>
> Thanks,
>
> Alvaro
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kmymoney-devel/attachments/20100815/a44e2b80/attachment.htm
More information about the KMyMoney-devel
mailing list