Review Request 125537: Use largest timestamp in subdirectory as resource directory timestamp.
David Faure
faure at kde.org
Tue Oct 6 07:22:22 UTC 2015
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125537/#review86409
-----------------------------------------------------------
Good catch, thanks - and nice to see a unittest as well.
src/sycoca/kbuildsycoca.cpp (line 148)
<https://git.reviewboard.kde.org/r/125537/#comment59534>
Couldn't TimestampChecker use TimestampFetcher (or just merge the two) to avoid the duplication of logic?
src/sycoca/kbuildsycoca.cpp (line 164)
<https://git.reviewboard.kde.org/r/125537/#comment59533>
The idea was to not look at the mtime of every file, that's just too slow. Instead, we know that the mtime of the dir is modified, when a file is created or removed. Not when modified by hand, but doing that requires running kbuildsycoca by hand.
So, swap this line with the next one, i.e. move it inside the isDir() check.
- David Faure
On Oct. 6, 2015, 2:18 a.m., Xuetian Weng wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125537/
> -----------------------------------------------------------
>
> (Updated Oct. 6, 2015, 2:18 a.m.)
>
>
> Review request for KDE Frameworks, Albert Astals Cid and David Faure.
>
>
> Repository: kservice
>
>
> Description
> -------
>
> In 0e4d7247e27f82a9b79b19dbceb35b603baceb76, a new feature saving directory mtime in ksycoca db is introduced.
>
> In the related code, TimestampChecker() will check the mtime recursively, but the building process will only read the top level directories' mtime, which causes ksycoca db being recreated again and again.
>
> I hit this because my ~/.config/menus/applications-merged mtime newer than ~/.config/menus. And plasmashell is running with 100% since it's creating ksycoca db repeatedly.
>
> This patch change the building db procedure to use the same logic as in TimestampChecker(), so building and checking are consistent now.
>
>
> Diffs
> -----
>
> autotests/ksycocatest.cpp 67f0700
> src/sycoca/kbuildsycoca.cpp 00aaac3
>
> Diff: https://git.reviewboard.kde.org/r/125537/diff/
>
>
> Testing
> -------
>
> Now a sub directory with larger timestamp than parent will not cause ksycoca data being recreated again and again.
>
>
> Thanks,
>
> Xuetian Weng
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20151006/db8f8fec/attachment.html>
More information about the Kde-frameworks-devel
mailing list